Issue Bug Closed

#107408Delete page with CEs as non-admin throws 'Attempt to delete record without delete-permissions.'

Christoph Freund 09/08/25, 07:52 updated 12/02/25, 13:58

Description

When I delete a page as a non-admin via context-menu (either in page-tree or in page-module)
the error ‘Attempt to delete record without delete-permissions.’ is shown.

The page gets deleted but not its content-elements, they still exists in the tt_content database without a deleted flag.

Reproduce

  1. With styleguide extension created the “styleguide frontend demo” test pages
  2. Created BE-user (editor)
  3. Switch to BE-user
  4. Create test page
  5. Created content-element
  6. Delete complete page via context-menu (right click)

Result:
> ‘Attempt to delete record without delete-permissions.’

A page with no content-elements can be deleted successfully, without any error.
The CE can be deleted if you only try to delete a placed element individually.

Reviews 2

Files 1

History 913

  1. Christoph Freund changed subject Delete page with as non-admin throws 'Attempt to delete record without delete-permissions.' Delete page with CEs as non-admin throws 'Attempt to delete record without delete-permissions.' <span data-processor="relativetime" data-value="2025-09-08T08:00:18+00:00" > 09/08/25, 08:00 </span>

  2. Kay Röseler commented and changed attached bugfix_core_delete_pages_with_content.patch <span data-processor="relativetime" data-value="2025-09-22T08:55:29+00:00" > 09/22/25, 08:55 </span>

    Christoph Freund wrote:
    > When I delete a page as a non-admin via context-menu (either in page-tree or in page-module)
    > the error ‘Attempt to delete record without delete-permissions.’ is shown.
    >
    > The page gets deleted but not its content-elements, they still exists in the tt_content database without a deleted flag.
    >
    > h2. Reproduce
    >
    > # With styleguide extension created the “styleguide frontend demo” test pages
    > # Created BE-user (editor)
    > # Switch to BE-user
    > # Create test page
    > # Created content-element
    > # Delete complete page via context-menu (right click)
    >
    > Result:
    > > ‘Attempt to delete record without delete-permissions.‘
    >
    > A page with no content-elements can be deleted successfully, without any error.
    > The CE can be deleted if you only try to delete a placed element individually.

    Hello Core Team,

    We have encountered the same problem here. According to debugging in v13, the error is caused by a change when deleting content elements on a page (when the entire page is deleted).

    In v11, the page ID was always passed as INT in the DataHandler when deleting the records of a page. In v13, however, the entire determined ROW (array) is now passed, which then causes a specification for the language check to fail in the backend validation (because there is only “UID => xxx” in the array).

    If you change this back to only passing the ID, the deletion of a page with content elements is executed correctly.

    Error throws in BackendUserAuthentication on Line 689 (language fields check)

    $this->errorMsg = 'ERROR: The "languageField" field named "'
                        . $GLOBALS['TCA'][$table]['ctrl']['languageField'] . '" was not found in testing record!';

    deleteSpecificPage in v11 on Line 5231:

    // Delete any further workspace overlays of the record in question, then delete the record.
    $this->discardWorkspaceVersionsOfRecord($table, $row['uid']);
    $this->deleteRecord($table, $row['uid'], true, $forceHardDelete);

    deleteSpecificPage in v13 on Line 5654:

    // Delete any further workspace overlays of the record in question, then delete the record.
    $this->discardWorkspaceVersionsOfRecord($table, (int)$row['uid']);
    $this->deleteRecord($table, $row, true, $forceHardDelete);

    The attached patch fixes the problems.

    Best regards,
    Kay

    Translated with DeepL.com (free version)

  3. Andy Meier commented <span data-processor="relativetime" data-value="2025-09-24T14:19:07+00:00" > 09/24/25, 14:19 </span>

    @kroeseler I can confirm, that your patch resolves the issue, which also occurs, wenn deleting pages by the regular delete button in the page properties view. Many thanks!

  4. Steffen Mächtel commented <span data-processor="relativetime" data-value="2025-09-24T14:43:57+00:00" > 09/24/25, 14:43 </span>

    I can also confirm the patch works for TYPO3 13. I will push this patch to gerrit.

  5. Georg Ringer commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2025-11-10T15:15:09+00:00" > 11/10/25, 15:15 </span>

    Applied in changeset commit:995b7c585cd83d7800d41d79e050417beedc4534.