Project

General

Profile

Actions

Bug #82053

closed

onlyAllowedTables is wrongly evaluated while changing doktype on page language overlay

Added by Patrik Karisch over 7 years ago. Updated about 6 years ago.

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

100%

Estimated time:
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

Actions

Also available in: Atom PDF