Skip to content

Commit

Permalink
[BUGFIX] Apply TCAdefaults to DataHandler if FormEngine was not used …
Browse files Browse the repository at this point in the history
…before

If TCAdefaults.pages.categories = 4 is used in userTSconfig, and a new
page is created via Drag&Drop or via "Create Multiple New Pages" via
ClickMenu, TCAdefaults are now added to the incomingFieldArray and
not just the fieldArray.

This is also great for translations (using "Just Localized"(tm) technology),
where the defaults are respected as well now.

Resolves: #92146
Resolves: #77847
Related: #89211
Releases: master, 10.4
Change-Id: I87a2f2d486831f9bda9a979c4ff99d4e8b2ada2f
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/68918
Tested-by: core-ci <typo3@b13.com>
Tested-by: Oliver Bartsch <bo@cedev.de>
Tested-by: Guido Schmechel <guido.schmechel@brandung.de>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Guido Schmechel <guido.schmechel@brandung.de>
Reviewed-by: Benni Mack <benni@typo3.org>
  • Loading branch information
bmack committed May 1, 2021
1 parent 0a8effb commit 10bcd26
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions typo3/sysext/core/Classes/DataHandling/DataHandler.php
Expand Up @@ -1068,6 +1068,11 @@ public function process_datamap()
(int)$this->BE_USER->firstMainGroup
);
}
// Ensure that the default values, that are stored in the $fieldArray (built from internal default values)
// Are also placed inside the incomingFieldArray, so this is checked in "fillInFieldArray" and
// all default values are also checked for validity
// This allows to set TCAdefaults (for example) without having to use FormEngine to have the fields available first.
$incomingFieldArray = array_replace_recursive($fieldArray, $incomingFieldArray);
}
// Processing of all fields in incomingFieldArray and setting them in $fieldArray
$fieldArray = $this->fillInFieldArray($table, $id, $fieldArray, $incomingFieldArray, $theRealPid, $status, $tscPID);
Expand Down

0 comments on commit 10bcd26

Please sign in to comment.