Skip to content

Commit

Permalink
[BUGFIX] Prevent malformed SQL query in list module
Browse files Browse the repository at this point in the history
A page outside of any site subtree has no available languages except the
default langauge (id 0). If a user is constrained to a non-default
language, opening the list module leads to an exception due to malformed
SQL query constraint.

Resolves: #102622
Releases: main, 12.4
Change-Id: I37d7c638ba41eff7bb22ef4b1eebbced00fa7c2e
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82142
Tested-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: core-ci <typo3@b13.com>
Reviewed-by: Guido Schmechel <guido.schmechel@brandung.de>
Tested-by: Guido Schmechel <guido.schmechel@brandung.de>
  • Loading branch information
fwg authored and sbuerk committed Mar 6, 2024
1 parent 3de3efa commit ab73703
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -2379,12 +2379,12 @@ public function getQueryBuilder(
}
}
if ($table === 'pages' && $this->showOnlyTranslatedRecords) {
$queryBuilder->andWhere(
$queryBuilder->expr()->in(
$GLOBALS['TCA']['pages']['ctrl']['languageField'],
$queryBuilder->andWhere($queryBuilder->expr()->in(
$GLOBALS['TCA']['pages']['ctrl']['languageField'],
$queryBuilder->quoteArrayBasedValueListToIntegerList(
array_keys($this->languagesAllowedForUser)
)
);
));
}
// Former prepareQueryBuilder
if ($maxResult > 0) {
Expand Down

0 comments on commit ab73703

Please sign in to comment.