Issue Bug Closed

#103237Page Tree Filter does not find newly created versioned records

Benni Mack 03/01/24, 07:35 updated 10/01/25, 12:47

Description

No description.

Reviews 2

History 1517

  1. Lina Wolf commented <span data-processor="relativetime" data-value="2024-03-04T09:23:41+00:00" > 03/04/24, 09:23 </span>

    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
    ```

  2. Benni Mack commented <span data-processor="relativetime" data-value="2024-03-04T09:56:24+00:00" > 03/04/24, 09:56 </span>

    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.

  3. Spawoz Technologies Pvt Ltd. commented <span data-processor="relativetime" data-value="2024-04-09T09:54:30+00:00" > 04/09/24, 09:54 </span>

    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

  4. Michael Blunck changed attached datahandler_fail.png attached datahandler.png <span data-processor="relativetime" data-value="2024-04-15T09:24:16+00:00" > 04/15/24, 09:24 </span>

  5. Tim Spiekerkötter commented <span data-processor="relativetime" data-value="2024-04-22T08:38:11+00:00" > 04/22/24, 08:38 </span>

    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

  6. Benni Mack commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2024-05-14T12:00:09+00:00" > 05/14/24, 12:00 </span>

    Applied in changeset commit:d818bb5357f13b4b1cbfb75d92a02726f5580f21.

  7. Stephan Großberndt commented <span data-processor="relativetime" data-value="2025-10-01T12:47:04+00:00" > 10/01/25, 12:47 </span>

    This issue pointed me in the right direction for having the same PHP error Undefined array key in frontend/Classes/Hooks/TreelistCacheUpdateHooks.php line 81 when trying to add a subpage to an existing page in the backend of a 12.4.37 installation.
    The pages table was not up to date in the database analyzer, there were two missing columns. After adding them the subpage could be created.