[!!!][BUGFIX] Reorder processing of TCA select items 13/55513/6
authorStefan Froemken <froemken@gmail.com>
Wed, 31 Jan 2018 16:42:09 +0000 (17:42 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 12 Feb 2018 12:06:57 +0000 (13:06 +0100)
It's now possible again to add and remove items via
pageTSconfig after itemsProcFunc has been processed
for TCA select fields.

Resolves: #75834
Releases: master
Change-Id: I6535f73c951a03abf3548c84877a08c4ea1ee2fa
Reviewed-on: https://review.typo3.org/55513
Reviewed-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Reiner Teubner <rteubner@me.com>
Reviewed-by: Tobi Kretschmann <tobi@tobishome.de>
Tested-by: Tobi Kretschmann <tobi@tobishome.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaSelectItems.php
typo3/sysext/core/Documentation/Changelog/master/Breaking-75834-ReorderProcessingOfTcaSelectItems.rst [new file with mode: 0644]

index b443521..11db844 100644 (file)
@@ -44,6 +44,14 @@ class TcaSelectItems extends AbstractItemProvider implements FormDataProviderInt
             }
 
             $fieldConfig['config']['items'] = $this->sanitizeItemArray($fieldConfig['config']['items'], $table, $fieldName);
+
+            // Resolve "itemsProcFunc"
+            if (!empty($fieldConfig['config']['itemsProcFunc'])) {
+                $fieldConfig['config']['items'] = $this->resolveItemProcessorFunction($result, $fieldName, $fieldConfig['config']['items']);
+                // itemsProcFunc must not be used anymore
+                unset($fieldConfig['config']['itemsProcFunc']);
+            }
+
             $fieldConfig['config']['maxitems'] = MathUtility::forceIntegerInRange($fieldConfig['config']['maxitems'], 0, 99999);
             if ($fieldConfig['config']['maxitems'] === 0) {
                 $fieldConfig['config']['maxitems'] = 99999;
@@ -71,13 +79,6 @@ class TcaSelectItems extends AbstractItemProvider implements FormDataProviderInt
 
             $removedItems = array_diff_key($removedItems, $fieldConfig['config']['items']);
 
-            // Resolve "itemsProcFunc"
-            if (!empty($fieldConfig['config']['itemsProcFunc'])) {
-                $fieldConfig['config']['items'] = $this->resolveItemProcessorFunction($result, $fieldName, $fieldConfig['config']['items']);
-                // itemsProcFunc must not be used anymore
-                unset($fieldConfig['config']['itemsProcFunc']);
-            }
-
             // needed to determine the items for invalid values
             $currentDatabaseValuesArray = $this->processDatabaseFieldValue($result['databaseRow'], $fieldName);
             $result['databaseRow'][$fieldName] = $currentDatabaseValuesArray;
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-75834-ReorderProcessingOfTcaSelectItems.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-75834-ReorderProcessingOfTcaSelectItems.rst
new file mode 100644 (file)
index 0000000..e348361
--- /dev/null
@@ -0,0 +1,34 @@
+.. include:: ../../Includes.txt
+
+=========================================================
+Breaking: #75834 - Reorder processing of TCA Select items
+=========================================================
+
+See :issue:`75834`
+
+
+Description
+===========
+
+It's now possible again to add and remove items via pageTSconfig after itemsProcFunc has been processed
+for TCA select fields.
+
+
+Impact
+======
+
+Items generated by itemsProcFunc no longer have the highest priority.
+
+
+Affected Installations
+======================
+
+Any installation that relied on itemsProcFunc being the source of truth for a given field.
+
+
+Migration
+=========
+
+Cross check if you added or removed items via pageTSconfig. These might be really gone now.
+
+.. index:: Backend, NotScanned