Project

General

Profile

Actions

Feature #17264

closed

Hook in TCEmain after all database operations needed

Added by Niels Pardon about 17 years ago. Updated almost 14 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
-
Start date:
2007-04-29
Due date:
% Done:

0%

Estimated time:
PHP Version:
5.2
Tags:
Complexity:
Sprint Focus:

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

0005530_seminars.patch (5.27 KB) 0005530_seminars.patch Administrator Admin, 2007-11-23 21:46
0005530.patch (1.12 KB) 0005530.patch Administrator Admin, 2007-11-23 21:47
0005530_v2.patch (654 Bytes) 0005530_v2.patch Administrator Admin, 2007-11-24 15:08
T3X_seminars-0_5_99-z-200711241606.t3x (623 KB) T3X_seminars-0_5_99-z-200711241606.t3x Administrator Admin, 2007-11-24 16:09

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #17043: Hook processDatamap_afterDatabaseOperations bug with inline relations?ClosedOliver Hader2007-02-26

Actions
Related to TYPO3 Core - Bug #17772: Hook processDatamap_afterDatabaseOperations bug with inline relationsClosedOliver Hader2007-11-10

Actions
Actions #1

Updated by Oliver Hader about 17 years ago

Niels and me talked about that at the T3DD07. I'm going to take care about the new hook.

Actions #2

Updated by Niels Pardon about 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!

Actions #3

Updated by Oliver Hader about 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).

Actions #4

Updated by Oliver Hader over 16 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.

Actions #5

Updated by Oliver Hader over 16 years ago

So, how does this work in tx_seminars now:
  • 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!

Actions #6

Updated by Niels Pardon over 16 years ago

Thank you very much for your help, Olly!

The modifications you made are working for me!

Actions #7

Updated by Niels Pardon over 16 years ago

T3X_seminars-0_5_99-z-200711241606.t3x is a patched version of tx_seminars for testing.

Actions #8

Updated by Oliver Hader over 16 years ago

Committed to SVN Trunk (rev. 2764).
Dropped for TYPO3_4-1.

Actions

Also available in: Atom PDF