Story #70274
closedDataPreprocessor gone? What Hook can i use to add values to new inline elements?
0%
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
Updated by Andreas Kienast about 9 years ago
- Status changed from New to Needs Feedback
Hi Philipp,
does this document help you? https://docs.typo3.org/typo3cms/extensions/core/latest/Changelog/7.5/Breaking-69568-FormEngine.html
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
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.
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.
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 :)
Updated by Georg Ringer almost 9 years ago
- Status changed from Needs Feedback to Closed