Bug #76977
closedDataHandler doesn't recognize doktype for Alternative Page Language the right way
0%
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
Updated by Nicole Cordes over 8 years ago
- Assignee set to Nicole Cordes
- Sprint Focus set to On Location Sprint
Updated by Nicole Cordes over 8 years ago
- Status changed from New to Needs Feedback
Hi Daniel,
I would love to be able to reproduce your problem. Would you mind to offer your configuration as well as your use case. I think I understand the problem but I'd like to verify it before solving.
BTW: Do you know how to contribute to the TYPO3 Core using Gerrit as review system? As you already have a solution for your problem, you could easily provide the patch.
Updated by Daniel Siepmann over 8 years ago
- File basic_fix.diff basic_fix.diff added
Here is a basic fix that should work.
But as $realPid
can be -1 and I don't know all circumstances of this method, I'm not sure whether this will be incompatible with further issues.
TYPO3 should check the real page, thus the pid in case of language overlays.
Updated by Daniel Siepmann over 8 years ago
Once more I try to describe how to reproduce the issue.
Configure allowed tables via https://docs.typo3.org/typo3cms/CoreApiReference/PageTypes/Index.html .
Configure one page type to not allow pages, so it's not possible to provide subpages.
Create one page and a language overlay.
Create another page with same uid as the language overlay has. This page should not allow pages.
Try to update the doktype of the language overlay. It will fail as not the pid of the overlay, the real page uid, will be used, but the uid of the language overlay. TYPO3 will look up the page with uid of the overlay, this is configured to not allow overlays.
Thus the editor will get a warning that the table is not allowed.
Updated by Riccardo De Contardi about 8 years ago
- Status changed from Needs Feedback to New
Updated by Anja Leichsenring about 7 years ago
- Sprint Focus deleted (
On Location Sprint)
Updated by Daniel Siepmann over 5 years ago
- Status changed from New to Closed
This should be solved with release of 9.x where the table has gone and only pages is left.