Skip to content

Commit

Permalink
[BUGFIX] Consider translated pages in workspaces
Browse files Browse the repository at this point in the history
This issue was raised that translated pages do not
show up in the list of records to be published/staged,
as translated pages are in the same table.

So, page handling needs to consider l10n_parent fields,
and check for the UID/l10n_parent, whereas other records
(like pages_language_overlay before) only are checked for
the "pid".

Resolves: #88446
Releases: master, 9.5
Change-Id: I9fe0b0290d4dd52104e15a08bb55e0aa7ab7473c
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60944
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: matseriks <mats@pixelant.se>
Tested-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: matseriks <mats@pixelant.se>
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
  • Loading branch information
bmack authored and ervaude committed Jun 27, 2019
1 parent 9235eaf commit a3b5f1c
Showing 1 changed file with 54 additions and 16 deletions.
70 changes: 54 additions & 16 deletions typo3/sysext/workspaces/Classes/Service/WorkspaceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,14 +307,33 @@ protected function selectAllVersionsFromPages($table, $pageList, $wsid, $filter,
];

if ($pageList) {
$pidField = $table === 'pages' ? 'uid' : 'pid';
$constraints[] = $queryBuilder->expr()->in(
'B.' . $pidField,
$queryBuilder->createNamedParameter(
GeneralUtility::intExplode(',', $pageList, true),
Connection::PARAM_INT_ARRAY
)
);
$pageIdRestriction = GeneralUtility::intExplode(',', $pageList, true);
if ($table === 'pages') {
$constraints[] = $queryBuilder->expr()->orX(
$queryBuilder->expr()->in(
'B.uid',
$queryBuilder->createNamedParameter(
$pageIdRestriction,
Connection::PARAM_INT_ARRAY
)
),
$queryBuilder->expr()->in(
'B.' . $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'],
$queryBuilder->createNamedParameter(
$pageIdRestriction,
Connection::PARAM_INT_ARRAY
)
)
);
} else {
$constraints[] = $queryBuilder->expr()->in(
'B.pid',
$queryBuilder->createNamedParameter(
$pageIdRestriction,
Connection::PARAM_INT_ARRAY
)
);
}
}

if ($isTableLocalizable && MathUtility::canBeInterpretedAsInteger($language)) {
Expand Down Expand Up @@ -480,14 +499,33 @@ protected function getMoveToPlaceHolderFromPages($table, $pageList, $wsid, $filt
}

if ($pageList) {
$pidField = $table === 'pages' ? 'B.uid' : 'A.pid';
$constraints[] = $queryBuilder->expr()->in(
$pidField,
$queryBuilder->createNamedParameter(
GeneralUtility::intExplode(',', $pageList, true),
Connection::PARAM_INT_ARRAY
)
);
$pageIdRestriction = GeneralUtility::intExplode(',', $pageList, true);
if ($table === 'pages') {
$constraints[] = $queryBuilder->expr()->orX(
$queryBuilder->expr()->in(
'B.uid',
$queryBuilder->createNamedParameter(
$pageIdRestriction,
Connection::PARAM_INT_ARRAY
)
),
$queryBuilder->expr()->in(
'B.' . $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'],
$queryBuilder->createNamedParameter(
$pageIdRestriction,
Connection::PARAM_INT_ARRAY
)
)
);
} else {
$constraints[] = $queryBuilder->expr()->in(
'A.pid',
$queryBuilder->createNamedParameter(
$pageIdRestriction,
Connection::PARAM_INT_ARRAY
)
);
}
}

$rows = $queryBuilder
Expand Down

0 comments on commit a3b5f1c

Please sign in to comment.