Bug #103237
closedPage Tree Filter does not find newly created versioned records
100%
Files
Updated by Gerrit Code Review 11 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
Updated by Lina Wolf 11 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
```
Updated by Benni Mack 11 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.
Updated by Spawoz Technologies Pvt Ltd. 10 months 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 10 months ago
- File datahandler_fail.png datahandler_fail.png added
- File datahandler.png datahandler.png added
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
Updated by Tim Spiekerkötter 10 months 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
Updated by Gerrit Code Review 9 months 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
Updated by Benni Mack 9 months ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset d818bb5357f13b4b1cbfb75d92a02726f5580f21.