Project

General

Profile

Actions

Story #70274

closed

DataPreprocessor gone? What Hook can i use to add values to new inline elements?

Added by Philipp Wrann about 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2015-10-01
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.6
Tags:
Sprint Focus:

Description

I just recognized, that there is no \TYPO3\CMS\Backend\Form\DataPreprocessor anymore, i used one signal sent by that class to add prefilled values to new inline elements (add new inline relations with recommendation-links from parent-record).

Could you give me a hint how i may achieve similar functionallity now?

I used that signal:
TYPO3\CMS\Backend\Form\DataPreprocessor::fetchRecordPostProcessing

It took me much time to dig into tceforms that deep...

What i did:

1) check if "ajaxID" is "t3lib_TCEforms_inline::createNewRecord"
2) check if arg0 is my record
3) check if arg3 is numeric (there i passed some value)
4) manipulate the record, that is about to be returned

Actions #1

Updated by Andreas Kienast about 9 years ago

  • Status changed from New to Needs Feedback
Actions #2

Updated by Philipp Wrann about 9 years ago

Thanks for your help

When i trace the request i allways get to InlineRelatedRecordResolver::getRecord(), there the new inline element is basically initialized i think.
The only point i can track down to add some data is within FormDataCompiler::compile::86, that calls TcaDatabaseRecord::compile.
There a loop iterates over $GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['formDataGroup']['tcaDatabaseRecord']

So i thought this might be a possibility, but when i manipulare the $result array directly in that method (by hacking the core itself) it does not change the values... So it might allready be to late?

I change one relation value and also the record-type, so its important to be processed at a certain time.

lost in code

Actions #3

Updated by Christian Kuhn about 9 years ago

inline is still a problem for the new data processing. i'm currently preparing a patch to change this.

Actions #4

Updated by Philipp Wrann about 9 years ago

using that hook:
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tceforms_inline.php']['tceformsInlineHook']

I can check if the current request is ajax:
if (GeneralUtility::_GP('ajaxID') === 't3lib_TCEforms_inline::createNewRecord')

And then i can manipulate the default values directly within TCA[columns]

initializeHooks is called very early, so this affects the rendering for my needs.

Actions #5

Updated by Philipp Wrann about 9 years ago

That das not work anymore in LTS because the hook is called too late, i now moved the functionallity to a xclass for InlineStackProcessor. Hail to the ObjectContainers :)

Actions #6

Updated by Georg Ringer almost 9 years ago

  • Status changed from Needs Feedback to Closed
Actions

Also available in: Atom PDF