Bug #82053

onlyAllowedTables is wrongly evaluated while changing doktype on page language overlay

Added by Patrik Karisch 12 months ago. Updated 5 months ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
DataHandler aka TCEmain
Target version:
-
Start date:
2017-08-07
Due date:
% Done:

100%

TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

When I change the doktype of a pages_language_overlay to a doktype which has onlyAllowedTables set, the call DataHandler::doesPageHaveUnallowedTables is done with the id of the pages_language_overlay entry, instead of with the real page uid which needs to be checked.

The affected part:

    public function checkValue($table, $field, $value, $id, $status, $realPid, $tscPID)
    {
        // Result array
        $res = [];

        // Processing special case of field pages.doktype
        if (($table === 'pages' || $table === 'pages_language_overlay') && $field === 'doktype') {
            // ...
            if ($status === 'update') {
                // This checks 1) if we should check for disallowed tables and 2) if there are records from disallowed tables on the current page
                $onlyAllowedTables = isset($GLOBALS['PAGES_TYPES'][$value]['onlyAllowedTables']) ? $GLOBALS['PAGES_TYPES'][$value]['onlyAllowedTables'] : $GLOBALS['PAGES_TYPES']['default']['onlyAllowedTables'];
                if ($onlyAllowedTables) {
                    // this is always called with the $id of the record, whether it is a pages or pages_language_overlay entry
                    $theWrongTables = $this->doesPageHaveUnallowedTables($id, $value);
                    if ($theWrongTables) {
                        // ...
                        return $res;
                    }
                }
            }
        }

        // ...
    }

Possible solution: Use $realPid if the record is pages_language_overlay or use $id if the record is pages

Associated revisions

Revision cbda51a7 (diff)
Added by Wolfgang Klinger 5 months ago

[BUGFIX] Use the real page id for doesPageHaveUnallowedTables check

In case of handling a translated page record, use the according
proper uid value of the containing page of default language.

Resolves: #82053
Releases: master, 8.7
Change-Id: I0d0b5a268f4b87ef44d892f046ef474624b18058
Reviewed-on: https://review.typo3.org/53687
Tested-by: TYPO3com <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>
Reviewed-by: Oliver Hader <>
Tested-by: Oliver Hader <>

Revision d328b91b (diff)
Added by Wolfgang Klinger 5 months ago

[BUGFIX] Use the real page id for doesPageHaveUnallowedTables check

In case of handling a translated page record, use the according
proper uid value of the containing page of default language.

Resolves: #82053
Releases: master, 8.7
Change-Id: I0d0b5a268f4b87ef44d892f046ef474624b18058
Reviewed-on: https://review.typo3.org/54672
Tested-by: TYPO3com <>
Reviewed-by: Oliver Hader <>
Tested-by: Oliver Hader <>

History

#1 Updated by Gerrit Code Review 11 months 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/53687

#2 Updated by Wolfgang Klinger 11 months ago

  • Assignee set to Wolfgang Klinger

#3 Updated by Gerrit Code Review 11 months 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/53687

#4 Updated by Gerrit Code Review 8 months ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54672

#5 Updated by Oliver Hader 5 months ago

  • Assignee deleted (Wolfgang Klinger)
  • Target version deleted (next-patchlevel)

#6 Updated by Gerrit Code Review 5 months 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/53687

#7 Updated by Gerrit Code Review 5 months 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/53687

#8 Updated by Gerrit Code Review 5 months ago

Patch set 2 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54672

#9 Updated by Gerrit Code Review 5 months ago

Patch set 3 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54672

#10 Updated by Wolfgang Klinger 5 months ago

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

Also available in: Atom PDF