Feature #17264
closedHook in TCEmain after all database operations needed
0%
Description
I'm a developer of the seminars extension and I plan to do the following. We got child-records called "timeslots" of the "seminar"-records which contain information that should be copied up to the parent record.
On TYPO3 4.0 I can use the processDatamap_afterDatabaseOperations() hook, because the "timeslot"-records are created before the "seminar"-record. So I can get the "timeslots" related to the "seminar"-record and copy the information to the "seminar"-record right after the "seminar"-record was saved.
In TYPO3 4.1 im using IRRE to manage those "timeslot"-records. With IRRE the saving order has changed. Now the "seminar"-record first gets saved and afterwards the "timeslot"-records are stored in the database.
The problem with this is, that when saving a "seminar" currently created "timeslots" are not present in the hook mentioned above and so I can't store the information of the "timeslots" in the "seminar"-record.
The solution should be a hook in TCEmain that takes place really after all database operations of all records created within this session.
(issue imported from #M5530)
Files
Updated by Oliver Hader over 17 years ago
Niels and me talked about that at the T3DD07. I'm going to take care about the new hook.
Updated by Niels Pardon over 17 years ago
Hi Oliver,
do you think it is possible that this hook gets implemented and published in TYPO3 4.1.2? I really would appreciate that!
Updated by Oliver Hader over 17 years ago
Unfortunately this is not possible for the 4.1.x branch. Hooks are new features and will only be applied to Trunk (TYPO3 4.2).
Updated by Oliver Hader almost 17 years ago
The attached file creates a new hook in TCEmain: processDatamap_afterAllOperations($this)
The patch for tx_seminar modifies the old behaviour to use this new hook.
Updated by Oliver Hader almost 17 years ago
- I created a new class variable in tx_seminars_tcemainprocdm: $tceMainFieldArrays
- I created a new method to use the new hook: processDatamap_afterAllOperations(&$pObj)
1) The hook for <b>processDatamap_afterDatabaseOperations</b> now just puts the information of the changed fields of the parameter $fieldArray to $this->tceMainFieldArrays - for all seminars and timeslots tables
2) Finally (after everything was done) the hook for <b>processDatamap_afterAllOperations</b> does the things that were formerly located in the processDatamap_afterDatabaseOperations method of that hook class - but it now takes it information from $this->tceMainFieldArrays
That's all!
Updated by Niels Pardon almost 17 years ago
Thank you very much for your help, Olly!
The modifications you made are working for me!
Updated by Niels Pardon almost 17 years ago
T3X_seminars-0_5_99-z-200711241606.t3x is a patched version of tx_seminars for testing.
Updated by Oliver Hader almost 17 years ago
Committed to SVN Trunk (rev. 2764).
Dropped for TYPO3_4-1.