Bug #100828
openUndefined array key error when inserting a page after copying
0%
Description
PHP Warning: Undefined array key "NEW6458a56ad522d182381312" in /var/www/xxxx.xxxx.xxx-xxx.xx/typo3_src-11.5.26/typo3/sysext/frontend/Classes/Hooks/TreelistCacheUpdateHooks.php line 81
Updated by Philipp Lüdtke 12 months ago
The $dataHandler->substNEWwithIDs array is empty and i don't know why. No previous errors get logged.
Updated by Frank Nägler 10 months ago
- Description updated (diff)
- Status changed from New to Needs Feedback
Can you please provide some more information about how to reproduce the issue?
Updated by Philipp Lüdtke 10 months ago
Tbh i have no idea how to reproduce it besides that it happened on inserting a page after copying (sometimes).
But i found this issue: https://forge.typo3.org/issues/98959
I think that might be just the same problem.
Updated by Marcin Sągol 6 months ago
Philipp, did this problem occur on a site where you had modified the pages TCA, or was it a clean core configuration?
I have tested it on my local env, using T3-dev and couldn't reporoduce the issue when copy/pasting pages.
Looking at the code, there are 3 places where this temporary ID to real ID could fail:
- DataHandler::insertDB() where we call $id = $this->postProcessDatabaseInsert($connection, $table, $suggestedUid); but here we always has some int value
- DataHandler::insertDB() wher we check if (!$dontSetNewIdIndex) { $this->substNEWwithIDs[$NEW_id] = $id; ... } ; but looking at the code, this condition is never met, maybe if you overwrite core functions or call this the DataHandler::insertDB() from custom code with this parameter set to true
- some wrong mapping of the temporary ID used deeper in T3 and in higher code parts, but i as i said, i cpuldn't reproduce it.