Bug #100828
closed
Undefined array key error when inserting a page after copying
Added by Philipp Lüdtke over 1 year ago.
Updated 6 months ago.
Sprint Focus:
Stabilization Sprint
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
The $dataHandler->substNEWwithIDs array is empty and i don't know why. No previous errors get logged.
- Sprint Focus set to Stabilization Sprint
- Description updated (diff)
- Status changed from New to Needs Feedback
Can you please provide some more information about how to reproduce the issue?
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.
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.
- Related to Bug #98959: Undefined array key "NEW_1" when adding (drag n drop) a new page added
- Status changed from Needs Feedback to Closed
can't be reproduced and the mentioned solution in http://forge.typo3.org/issues/98959#note-3 might solve it here as well.
if the issue is still valid for you, feel free to open a new issue and reference this one. thanks!
Also available in: Atom
PDF