#105343Invalid selection of content elements given on translate or copy function when a content element has no relation
Description
Function `->getRecordsToCopyDatabaseResult()` should return all elements which are available for selection for translation or copy. However imagine you have default language (EN) and translation German (2). Where the there are 10 content elements in default and only 6 of them translated in German.
When 1 content element is set in german which does not have any relation (so l10n_source = 0) the while loop exits.
@
while ($origUid = $originalUidsStatement->fetchOne()) {
$originalUids[] = (int)$origUid;
}@
If this happens to be the 2nd element in the array all others are skipped and not taking into the next query to exclude them from listing. Resulting in a list of items which are available for translation or copy while there already is an content element with a translation.
Reviews 1
Fix this issue
Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". The changes above were merged or abandoned: read them before you start. How to create a patch
- Commit message
-
[BUGFIX] Invalid selection of content elements given on translate or copy function when a content element has no relation Resolves: #105343 Releases: main
Related issues 1
History 45
-
Nikita Hovratov changed Related to #97763 <span data-processor="relativetime" data-value="2024-10-25T19:09:00+00:00" > 10/25/24, 19:09 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 94531 status
NewUnder Review <span data-processor="relativetime" data-value="2026-06-18T22:57:24+00:00" > 06/18/26, 22:57 </span> -
Alexander Stehlik changed Duplicates #92937 <span data-processor="relativetime" data-value="2026-06-18T22:59:49+00:00" > 06/18/26, 22:59 </span>
-
Benni Mack changed status
Under ReviewNew <span data-processor="relativetime" data-value="2026-11-09T11:02:52+00:00" > 11/09/26, 11:02 </span>
Possible fix: Instead of while loop
$results = $originalUidsStatement->fetchAllAssociative();
foreach ($results as $row) {
if((int)$row['l10n_source'] === 0) {
continue;
}
$originalUids[] = (int)$row['l10n_source'];
}