Skip to content

Commit c946bba

Browse files
committed
Fixes incorrect handling of 'kod' key in array checks
Ensures proper validation for the presence of the 'kod' key in arrays when determining values, defaulting to 'id' if 'kod' is absent. This improves robustness by explicitly checking for the existence of the 'kod' key using `array_key_exists`, avoiding potential undefined index errors.
1 parent 5389ec1 commit c946bba

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

debian/changelog

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
php-spojenet-abraflexi (3.6.3) UNRELEASED; urgency=medium
1+
php-spojenet-abraflexi (3.6.4) UNRELEASED; urgency=medium
22

3+
* fixRecordTypes now can handle relation without code
4+
5+
-- vitex <[email protected]> Tue, 21 Oct 2025 14:58:59 +0200
6+
7+
php-spojenet-abraflexi (3.6.3) experimental; urgency=medium
8+
9+
[ Vitex ]
310
* traits added into ObjednavkaVydana
411

5-
-- Vitex <vitezslav.dvorak@spojenet.cz> Mon, 29 Sep 2025 23:02:37 +0200
12+
-- vitex <info@vitexsoftware.cz> Tue, 21 Oct 2025 14:56:34 +0200
613

714
php-spojenet-abraflexi (3.6.2) experimental; urgency=medium
815

src/AbraFlexi/RO.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,7 @@ public function fixRecordTypes(array $record, $evidence = null)
10901090
$valueFields = array_keys($value);
10911091
$subject = next($valueFields);
10921092
$record[$column] = new Relation(
1093-
\is_array($value) ? ($value['kod'] ?: $value['id']) : $value,
1093+
\is_array($value) ? (\array_key_exists('kod', $value) ? $value['kod'] : $value['id']) : $value,
10941094
\array_key_exists('fkEvidencePath', $columnInfo) && null !== $columnInfo['fkEvidencePath'] ? $columnInfo['fkEvidencePath'] : $column,
10951095
\array_key_exists($subject.'@ref', $value) ? $record[$subject.'@ref'] : $value['id'],
10961096
\array_key_exists($subject.'@showAs', $value) ? $value[$subject.'@showAs'] : null,

0 commit comments

Comments
 (0)