[BUGFIX] Coalesce hook calls in DataHandler::processRemapStack() 57/52257/2
authorThomas Hohn <thomas@hohn.dk>
Mon, 6 Feb 2017 11:01:25 +0000 (12:01 +0100)
committerOliver Hader <oliver.hader@typo3.org>
Thu, 30 Mar 2017 10:29:54 +0000 (12:29 +0200)
commit4a7c5a9f34f76679cc8912c6d61ffe9371cc0759
treec738f76d9eb94c4bbdcf334b60a30e07aeaebb9c
parent8ce9a1efd7b2c90875b5b59ec0fa765defb6633a
[BUGFIX] Coalesce hook calls in DataHandler::processRemapStack()

DataHandler's hook processDatamap_afterDatabaseOperations is processed
in two ways. In case modifications do not contain any new relation that
just has been created, the hook is executed directly. If that's not the
case, executing this hook is deferred and will happen after the remap
stack has been processed.

Calling the hook directly happens exactly once for each modified record,
where invocations in DataHandler::processRemapStack() might happen more
than once, depending on the amount of relation fields that contain new
references and have been remapped.

This change coalesces these invocations which results that the hooks
processDatamap_afterDatabaseOperations is exactly called once for each
modified record - which is the expected behavior.

Change-Id: Ib7e65ce170c8f9ba8f7577b79073b1ed9213a0b9
Resolves: #79635
Releases: master, 7.6
Reviewed-on: https://review.typo3.org/51552
Reviewed-on: https://review.typo3.org/52257
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
typo3/sysext/core/Classes/DataHandling/DataHandler.php
typo3/sysext/core/Tests/Functional/DataHandling/DataHandler/HookTest.php