Project

General

Profile

Actions

Bug #100828

open

Undefined array key error when inserting a page after copying

Added by Philipp Lüdtke 12 months ago. Updated 6 months ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2023-05-08
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.1
Tags:
Complexity:
Is Regression:
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

Actions #1

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.

Actions #2

Updated by Benni Mack 11 months ago

  • Sprint Focus set to Stabilization Sprint
Actions #3

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?

Actions #4

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.

Actions #5

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.

Actions

Also available in: Atom PDF