Bug #100828
closedUndefined 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 over 1 year ago
The $dataHandler->substNEWwithIDs array is empty and i don't know why. No previous errors get logged.
Updated by Frank Nägler over 1 year 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 over 1 year 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 about 1 year 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.
Updated by Georg Ringer 6 months ago
- Related to Bug #98959: Undefined array key "NEW_1" when adding (drag n drop) a new page added
Updated by Georg Ringer 6 months ago
- 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!