Bug #69282
closed
Mistake in FormEngine.php: hook getMainFields_preProcess cannot change databaseRow
Added by Federico Bernardin about 9 years ago.
Updated about 9 years ago.
Category:
FormEngine aka TCEforms
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.
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.
- 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
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
- Target version changed from 7.4 (Backend) to 7 LTS
- Status changed from New to Closed
Also available in: Atom
PDF