Project

General

Profile

Actions

Bug #76977

closed

DataHandler doesn't recognize doktype for Alternative Page Language the right way

Added by Daniel Siepmann almost 8 years ago. Updated about 5 years ago.

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

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
7.0
Tags:
Complexity:
medium
Is Regression:
No
Sprint Focus:

Description

It's possible to configure allowed tables per page type via https://docs.typo3.org/typo3cms/CoreApiReference/PageTypes/Index.html .
As soon as you have configure to not allow "pages" below a specific page type everything works as expected for records of type "pages" but not for "Alternative Page Language".

The process is handled in TYPO3\CMS\Core\DataHandling\DataHandler::checkValue where:

// Processing special case of field pages.doktype                                         
if (($table === 'pages' || $table === 'pages_language_overlay') && $field === 'doktype') {

Inside this condition, $theWrongTables = $this->doesPageHaveUnallowedTables($id, $value); is called which will do $count = $this->databaseConnection->exec_SELECTcountRows('uid', $table, 'pid=' . (int)$page_uid); so not taking care of the real uid.

Fix
The $id passed to doesPageHaveUnallowedTables has to be the real uid, so in case of pages_language_overlay it has to be the pid instead of uid.


Files

basic_fix.diff (1.03 KB) basic_fix.diff Daniel Siepmann, 2016-07-20 08:53
Actions

Also available in: Atom PDF