Fixed duplicate check

This commit is contained in:
Jan Böhmer 2025-11-11 23:56:21 +01:00
parent ac8b119414
commit 181658501b
2 changed files with 12 additions and 4 deletions

View file

@ -88,6 +88,8 @@ class TypeSynonymsCollectionType extends AbstractType
function (array $viewValue) {
//Turn our flat list back into the structured array
$out = [];
foreach ($viewValue as $row) {
if (!is_array($row)) {
continue;
@ -133,8 +135,8 @@ class TypeSynonymsCollectionType extends AbstractType
$ds = $row['dataSource'] ?? null;
$loc = $row['locale'] ?? null;
if (is_string($ds) && $ds !== '' && is_string($loc) && $loc !== '') {
$key = $ds . '|' . $loc;
if ($ds !== null && is_string($loc) && $loc !== '') {
$key = $ds->value . '|' . $loc;
if (isset($seen[$key])) {
$hasDuplicate = true;

View file

@ -347,13 +347,13 @@
<target>Due to technical limitations, it is not possible to select dates after the 2038-01-19 on 32-bit systems!</target>
</segment>
</unit>
<unit id="89nojXY" name="validator.fileSize.invalidFormat">
<unit id="iM9yb_p" name="validator.fileSize.invalidFormat">
<segment state="translated">
<source>validator.fileSize.invalidFormat</source>
<target>Invalid file size format. Use an integer number plus K, M, G as suffix for Kilo, Mega or Gigabytes.</target>
</segment>
</unit>
<unit id="iXcU7ce" name="validator.invalid_range">
<unit id="ZFxQ0BZ" name="validator.invalid_range">
<segment state="translated">
<source>validator.invalid_range</source>
<target>The given range is not valid!</target>
@ -365,5 +365,11 @@
<target>Invalid code. Check that your authenticator app is set up correctly and that both the server and authentication device has the time set correctly.</target>
</segment>
</unit>
<unit id="I330cr5" name="settings.synonyms.type_synonyms.collection_type.duplicate">
<segment>
<source>settings.synonyms.type_synonyms.collection_type.duplicate</source>
<target>There is already a translation defined for this type and language!</target>
</segment>
</unit>
</file>
</xliff>