Project

General

Profile

Actions

Bug #105343

open

Invalid selection of content elements given on translate or copy function when a content element has no relation

Added by Joey Bouten 13 days ago. Updated 13 days ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Localization
Start date:
2024-10-18
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
13
PHP Version:
8.3
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

Description

https://github.com/TYPO3/typo3/blob/main/typo3/sysext/backend/Classes/Domain/Repository/Localization/LocalizationRepository.php

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.


Related issues 1 (1 open0 closed)

Related to TYPO3 Core - Bug #97763: Translation Button shown eventhough already translatedUnder ReviewJo Hasenau2022-06-13

Actions
Actions #1

Updated by Joey Bouten 13 days 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'];
}

Actions #2

Updated by Nikita Hovratov 6 days ago

  • Related to Bug #97763: Translation Button shown eventhough already translated added
Actions

Also available in: Atom PDF