Skip to content

Commit 2ebf37a

Browse files
committed
Fixes incorrect ID handling in relation initialization
Updates the logic for initializing Relation objects to correctly use the 'id' field from arrays instead of the first element. This ensures accurate mapping of relation data and prevents potential mismatches when processing records.
1 parent 5567c91 commit 2ebf37a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/AbraFlexi/RO.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,7 @@ public function fixRecordTypes(array $record, $evidence = null)
10741074
if (\is_array($record[$column])) {
10751075
foreach ($record[$column] as $pos => $value) {
10761076
$record[$column][$pos] = new Relation(
1077-
\is_array($value) ? $value[0] : $value,
1077+
\is_array($value) ? $value['id'] : $value,
10781078
\array_key_exists('fkEvidencePath', $columnInfo) && null !== $columnInfo['fkEvidencePath'] ? $columnInfo['fkEvidencePath'] : $column,
10791079
\array_key_exists($column.'@ref', $record) ? $record[$column.'@ref'] : null,
10801080
\array_key_exists($column.'@showAs', $record) ? $record[$column.'@showAs'] : null,

0 commit comments

Comments
 (0)