mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-20 18:09:30 +00:00
Fixed duplicate check
This commit is contained in:
parent
ac8b119414
commit
181658501b
2 changed files with 12 additions and 4 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue