Bug #105343
openInvalid selection of content elements given on translate or copy function when a content element has no relation
0%
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.
Updated by Joey Bouten about 1 month ago ยท Edited
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'];
}
Updated by Nikita Hovratov 27 days ago
- Related to Bug #97763: Translation Button shown eventhough already translated added