Project

General

Profile

Actions

Bug #103237

closed

Page Tree Filter does not find newly created versioned records

Added by Benni Mack over 1 year ago. Updated 12 months ago.

Status:
Closed
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:
Actions #1

Updated by Gerrit Code Review over 1 year 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 over 1 year 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 over 1 year 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 year 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

Actions #5

Updated by Michael Blunck about 1 year ago · Edited

  • File datahandler_fail.png added
  • File datahandler.png added
Actions #6

Updated by Tim Spiekerkötter about 1 year 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 about 1 year ago

  • Target version changed from 13.1 to 13.2
Actions #8

Updated by Gerrit Code Review about 1 year 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 about 1 year ago

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

Updated by Benni Mack 12 months ago

  • Status changed from Resolved to Closed
Actions #11

Updated by Michael Blunck about 2 months ago

  • File deleted (datahandler_fail.png)
Actions #12

Updated by Michael Blunck about 2 months ago

  • File deleted (datahandler.png)
Actions

Also available in: Atom PDF