Project

General

Profile

Actions

Bug #103237

closed

Page Tree Filter does not find newly created versioned records

Added by Benni Mack 3 months ago. Updated 6 days ago.

Status:
Resolved
Priority:
Should have
Assignee:
Category:
Workspaces
Target version:
Start date:
2024-03-01
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
13
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Files

datahandler_fail.png (15.5 KB) datahandler_fail.png Michael Blunck, 2024-04-15 09:23
datahandler.png (50.2 KB) datahandler.png Michael Blunck, 2024-04-15 09:23
Actions #1

Updated by Gerrit Code Review 3 months ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83167

Actions #2

Updated by Lina Wolf 3 months ago · Edited

We seem to have the same issue without using workspaces. In one of our projects with TYPO3 v12.4.11 we get an error in the page tree filter whenever we try to add a new page using the data handler:

PHP Warning: Undefined array key "NEW65e584cf06bad935695744" in /home/www/xxx/vendor/typo3/cms-frontend/Classes/Hooks/TreelistCacheUpdateHooks.php line 81

More information regarding this error might be available online.

Following patch would solve it:

```
Index: Classes/Hooks/TreelistCacheUpdateHooks.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8 ===================================================================
diff --git a/Classes/Hooks/TreelistCacheUpdateHooks.php b/Classes/Hooks/TreelistCacheUpdateHooks.php
--- a/Classes/Hooks/TreelistCacheUpdateHooks.php
++ b/Classes/Hooks/TreelistCacheUpdateHooks.php (date 1709543377998)
@ -78,7 +78,7 @
if ($status === 'new') {
// Detect new pages
// Resolve the uid
- $affectedPageUid = $dataHandler->substNEWwithIDs[$recordId];
$affectedPageUid = $dataHandler->substNEWwithIDs[$recordId] ?? 0;
$affectedPagePid = $updatedFields['pid'];
} elseif ($status === 'update') {
// Detect updated pages
```

Actions #3

Updated by Benni Mack 3 months ago

Lina Wolf wrote in #note-2:

We seem to have the same issue without using workspaces. In one of our projects with TYPO3 v12.4.11 we get an error in the page tree filter whenever we try to add a new page using the data handler:

PHP Warning: Undefined array key "NEW65e584cf06bad935695744" in /home/www/xxx/vendor/typo3/cms-frontend/Classes/Hooks/TreelistCacheUpdateHooks.php line 81

Hey Lina,

these are two different issues, right? I cannot reproduce your issue.

Actions #4

Updated by Spawoz Technologies Pvt Ltd. about 1 month ago

Hi Ben,

I can also confirm the issue of Lina reported. When I tried to copy a page and paste, this issue happened. I tried with TYPO3 v12.4.13. Note: I was trying to upgrade a system from 10.4 to 12.4.

Thank you,
Arun

Updated by Michael Blunck about 1 month ago

I had the same error message.

Even after a very large update from 8.7 to 12.4.
At this point, check line 7810 in the TYPO3\CMS\Core\DataHandling\Datahandler class.

Here I could find out that there were old database fields that were not configured correctly.
After I corrected the errors here, it worked as expected.

Hope this help

Actions #6

Updated by Tim Spiekerkötter 28 days ago

Hi Michael,

this helped immensely! Thanks!

Information for others encountering this issue:

We had the pages extended with a select field. Our problem was, that the field had NOT defined a "default" and the database was set to INT NOT NULL. But even tho the documentation states that "Default value set if a new record is created. If empty, the first element in the items array is selected." this does not seem to be the case for a "foreign_table" select.

Without setting the "default" to 0 inside the TCA the DataHandler gets the following SQL error: "Incorrect integer value: '' for column `mydatabase`.`pages`.`myfield` at row 1" in the insertDB method. This however does not get logged. Instead we only get "PHP Warning: Undefined array key "NEW662621357cbff613450439" in /app/vendor/typo3/cms-frontend/Classes/Hooks/TreelistCacheUpdateHooks.php line 81" in the log.

After setting the default to 0 everything works fine.

Cheers,
Tim

Actions #7

Updated by Benni Mack 18 days ago

  • Target version changed from 13.1 to 13.2
Actions #8

Updated by Gerrit Code Review 6 days ago

Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84292

Actions #9

Updated by Benni Mack 6 days ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF