[BUGFIX] Omit checkbox for unselectable tree items 06/58306/2
authorSebastian Michaelsen <sebastian@michaelsen.io>
Thu, 13 Sep 2018 09:49:42 +0000 (11:49 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 17 Sep 2018 15:08:03 +0000 (17:08 +0200)
TCA select fields with renderType = 'selectTree' have the option
treeConfig.appearance.nonSelectableLevels, which doesn't seem
to work anymore since TYPO3 v7. The items are correctly flagged
with node.selectable = false in PHP but the JavaScript doesn't
check for that property.

Resolves: #84708
Releases: master, 8.7
Change-Id: Iefe98e1c9fd316f05c27ad1230d63236a7069bf1
Reviewed-on: https://review.typo3.org/58306
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Resources/Public/JavaScript/FormEngine/Element/SvgTree.js

index 9b50ee8..ec883b6 100644 (file)
@@ -184,6 +184,8 @@ define(['jquery', 'd3'], function($, d3) {
           }
           if (typeof node.checked == 'undefined') {
             node.checked = false;
+          }
+          if (node.selectable === false) {
             me.settings.unselectableElements.push(node.identifier);
           }
           //dispatch event