Bug #69282

Mistake in FormEngine.php: hook getMainFields_preProcess cannot change databaseRow

Added by Federico Bernardin almost 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Must have
Category:
FormEngine aka TCEforms
Target version:
Start date:
2015-08-24
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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.

#1

Updated by Christian Kuhn almost 6 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.

#2

Updated by Federico Bernardin almost 6 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

#3

Updated by Eugene Skomorokhov almost 6 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

#4

Updated by Stephan Großberndt almost 6 years ago

  • Target version changed from 7.4 (Backend) to 7 LTS
#5

Updated by Morton Jonuschat almost 6 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:

https://docs.typo3.org/typo3cms/extensions/core/latest/Changelog/7.5/Feature-69568-FormEngineDataProcessing.html

Also available in: Atom PDF