The TCA tree feature did not work when setting maxitems=1 in the TCA.
This bug has been fixed in master in
290529a75647fe2bf6847638763e50348631e906 and in
TYPO3_4-5 branch
3019ca92f55faf650ad5981a001e323a2e91eab6 but the solution is different.
Use the same solution as is TYPO3_4-5 because it is cleaner:
* Check for empty() value instead of comparing with 0 in
t3lib/tceforms/class.t3lib_tceforms_tree.php
* Do not recalculate the number of checked items only if a new
item is checked and the maximum item count is reached instead of always
recalculating the item count in
t3lib/js/extjs/tree/tree.js
Resolves: #25347
Releases: 4.6
Change-Id: I1b55960f9c26f57aa05d6a95a9980798c06e8316
Reviewed-on: http://review.typo3.org/1804
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
}
}
- if (this.countSelectedNodes >= this.tcaMaxItems) {
+ if (checked === true && this.countSelectedNodes >= this.tcaMaxItems) {
checkedNode.attributes.checked = false;
checkedNode.getUI().toggleCheck(false);
- checked = false;
+ this.resumeEvents();
+ return false;
}
if (checked) {
checkedNode.getUI().addClass('complete');
$valueArray = array();
$selectedNodes = array();
- if($PA['itemFormElValue'] != 0) {
+ if(!empty($PA['itemFormElValue'])) {
$valueArray = explode(',', $PA['itemFormElValue']);
}