Project

General

Profile

Actions

Bug #85824

closed

Trying to delete page with subpages with translations as admin gives error: "Attempt to delete page without permissions"

Added by Sybille Peters over 5 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
DataHandler aka TCEmain
Target version:
-
Start date:
2018-08-13
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
Actions #1

Updated by Stephan Großberndt over 5 years ago

  • Status changed from New to Needs Feedback

Did you go to "User settings" -> "Edit and Advanced functions" and enabled the checkbox at "Recursive Delete(!): Allow ALL subpages to be deleted when deleting a page"? In TYPO3 7.6 and 8.7 this definitely is not a general problem (you chose 7 as TYPO3 version for this bug)..

Actions #2

Updated by Sybille Peters over 5 years ago

  • Status changed from Needs Feedback to Closed

@Stephan Yes, I did, but as I have been unable to reproduce this now, I will close.

Actions #3

Updated by Sybille Peters about 4 years ago

  • Subject changed from Trying to delete pages with subpages as admin gives error: "Attempt to delete page without permissions" to Trying to delete page with subpages with translations as admin gives error: "Attempt to delete page without permissions"
  • Status changed from Closed to New
  • TYPO3 Version changed from 7 to 9

I still get this problem and I can reproduce it now: It happens when trying to delete pages with translations pages.

Tested with current 9.5.

Problem occurs if deletion is performed in Backend as system user.

I get the error message: "Attempt to delete page without permissions" 

I have set the recursive delete option so that is not the problem.

  • delete page without translation: no error
  • delete page with translation (and no subpages): no error
  • delete page without translation + subpage without translation: no error
  • delete page with subpage with translation: ERROR
Actions #4

Updated by Sybille Peters about 4 years ago

I can also reproduce this with latest master (10.4-dev)

Actions #5

Updated by Sybille Peters about 4 years ago

The problem seems to be in the order deletion of pages with translations is performed in DataHandler::deleteRecord()

GeneralUtility::makeInstance(ConnectionPool::class)
    ->getConnectionForTable($table)
    ->delete($table, ['uid' => (int)$uid]);
$this->deletedRecords[$table][] = (int)$uid;
$this->deleteL10nOverlayRecords($table, $uid);

which results in the original page already being deleted when canDeletePage is called:

DataHandler::canDeletePage($uid)
{
        $uid = (int)$uid;
        $isTranslatedPage = null;

        // If we may at all delete this page
        // If this is a page translation, do the check against the perms_* of the default page
        // Because it is currently only deleting the translation
        $defaultLanguagePageId = $this->getDefaultLanguagePageId($uid);
        if ($defaultLanguagePageId !== $uid) {
            if ($this->doesRecordExist('pages', (int)$defaultLanguagePageId, 'delete')) {
                $isTranslatedPage = true;
            } else {
                return 'Attempt to delete page without permissions';
            }

The problem happens when this function is called for the translated page. In that case, the original page was already deleted (deleted=1) and the function doesRecordExist() will fail.

Actions #6

Updated by Gerrit Code Review about 4 years ago

  • Status changed from New to Under Review

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

Actions #7

Updated by Gerrit Code Review about 4 years ago

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

Actions #8

Updated by Gerrit Code Review about 4 years ago

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

Actions #9

Updated by Gerrit Code Review about 4 years ago

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

Actions #10

Updated by Gerrit Code Review about 4 years ago

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

Actions #11

Updated by Gerrit Code Review about 4 years ago

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

Actions #12

Updated by Sybille Peters about 4 years ago

  • Category changed from Backend API to DataHandler aka TCEmain
Actions #13

Updated by Gerrit Code Review about 4 years ago

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

Actions #14

Updated by Sybille Peters about 4 years ago

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

Updated by Benni Mack about 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF