[BUGFIX] TCA maximumRecordsChecked should display message 64/27264/3
authorBenjamin Mack <benni@typo3.org>
Sun, 2 Feb 2014 14:38:45 +0000 (15:38 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 4 Mar 2014 17:16:49 +0000 (18:16 +0100)
The new eval function "maximumRecordsChecked"
silently disables the checkbox again when the
maximum number of records has been reached.

The patch adds a log entry for the user on saving
the record.

You can test this change with #55177.

Resolves: #55590
Releases: 6.2
Change-Id: Ie8489f6b8fe519130689098968ae28fabe7c7b8e
Reviewed-on: https://review.typo3.org/27264
Reviewed-by: Frans Saris
Tested-by: Frans Saris
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/core/Classes/DataHandling/DataHandler.php

index 8de75cf..2a065a5 100644 (file)
@@ -1721,6 +1721,7 @@ class DataHandler {
                        // if so, set this value to "0" again
                        if ($maxCheckedRecords && count($otherRecordsWithSameValue) >= $maxCheckedRecords) {
                                $value = 0;
+                               $this->log($table, $id, 5, 0, 1, 'Could not activate checkbox for field "%s". A total of %s record(s) can have this checkbox activated. Uncheck other records first in order to activate the checkbox of this record.', -1, array($GLOBALS['LANG']->sL(BackendUtility::getItemLabel($table, $field)), $maxCheckedRecords));
                        }
                }
                $res['value'] = $value;