[BUGFIX] Custom select renderTypes use TcaSelectItems 25/50325/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Sat, 22 Oct 2016 15:46:09 +0000 (17:46 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Mon, 24 Oct 2016 17:48:14 +0000 (19:48 +0200)
There are two FormEngine data provider for type=select: TcaSelectItems
for "normal" renderTypes and TcaSelectTreeItems for renderType="selectTree".

While this is hacky in the first place - the data provider should not
depend on renderType at all but only on type, this can not be changed
easily and a real solution is to make "trees" an own type instead, later.

However, if extensions add a new renderType for select at the moment, the
normal TcaSelectItems data provider does not kick in since it is restricted
to the known renderTypes. This is usually not what an extension wants,
typically just the rendering is different while the data providing from
TcaSelectItems is used.

The patch allows this by now blacklisting "selectTree" in TcaSelectItems
instead of whitelisting the known types.

Change-Id: Ic71177e22b191a5abee90a7cfb9871167fe4611e
Resolves: #78381
Releases: master, 7.6
Reviewed-on: https://review.typo3.org/50325
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de>
Reviewed-by: Mamadou Mbow <mmbow@dfau.de>
Tested-by: Mamadou Mbow <mmbow@dfau.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>

index c37fff3..79fc498 100644 (file)
@@ -152,10 +152,6 @@ class TcaSelectItems extends AbstractItemProvider implements FormDataProviderInt
     protected function isTargetRenderType(array $fieldConfig)
-        return in_array(
-            $fieldConfig['config']['renderType'],
-            ['selectSingle', 'selectSingleBox', 'selectCheckBox', 'selectMultipleSideBySide'],
-            true
-        );
+        return $fieldConfig['config']['renderType'] !== 'selectTree';