Bug #69282
closedMistake in FormEngine.php: hook getMainFields_preProcess cannot change databaseRow
0%
Description
The hook getMainFields_preProcess in FormEngine was useful to change the database row. In all TYPO3 CMS version before 7.4 the hook could change the database row, from 7.4 the code line $this->databaseRow = $database is before the hook, so we cannot change it anymore inside the hook implementation.
To resolve this behavior you can move the code line $this->databaseRow = $databaseRow; after the hook call.
The method is getMainFields.
Updated by Christian Kuhn about 9 years ago
Hey. This hook will vanish with the next patch completely and there will be a much more flexible way to change data submitted to the render engine.
Updated by Federico Bernardin about 9 years ago
- Assignee set to Christian Kuhn
Hi Christian, what you said sounds strange for me. Where is defined the deprecate/remove string for getMainFields_preProcess hook?
Could you tell me what is the more flexible way to change the data submitted?
Thanks
Federico
Updated by Eugene Skomorokhov about 9 years ago
Confirmed. The code:
$this->databaseRow = $databaseRow; // Hook: getMainFields_preProcess foreach ($this->hookObjectsMainFields as $hookObj) { if (method_exists($hookObj, 'getMainFields_preProcess')) { $hookObj->getMainFields_preProcess($table, $databaseRow, $this); } }
should be changed to something like:
// Hook: getMainFields_preProcess foreach ($this->hookObjectsMainFields as $hookObj) { if (method_exists($hookObj, 'getMainFields_preProcess')) { $hookObj->getMainFields_preProcess($table, $databaseRow, $this); } } $this->databaseRow = $databaseRow;
Regards,
Eugene
Updated by Stephan Großberndt about 9 years ago
- Target version changed from 7.4 (Backend) to 7 LTS
Updated by Morton Jonuschat about 9 years ago
- Status changed from New to Closed
The referenced hook has been removed with the FormEngine rewrite that got merged into TYPO CMS 7.5. The according documentation regarding the breaking changes can be found here:
https://docs.typo3.org/typo3cms/extensions/core/latest/Changelog/7.5/Breaking-69568-FormEngine.html
Information on how to transform data before the form elements get rendered can be found here: