diff --git a/src/AbraFlexi/ui/RecordTypeSelect.php b/src/AbraFlexi/ui/RecordTypeSelect.php index 2cc3e0a..b423a84 100644 --- a/src/AbraFlexi/ui/RecordTypeSelect.php +++ b/src/AbraFlexi/ui/RecordTypeSelect.php @@ -36,9 +36,8 @@ public function __construct($engine, $valueType = 'id', $conditions = []) $types[($valueType == 'kod' ? 'code:' : '').$type[$valueType]] = $type['nazev']; } } - parent::__construct($engine->getEvidence(), $types, - ($valueType == 'kod' ? \AbraFlexi\RO::code($engine->getDataValue($valueType)) - : $engine->getDataValue($valueType)) - ); + $default = $engine->getDataValue($valueType); + + parent::__construct($engine->getEvidence(), $types, ( $valueType == 'kod' && !empty($default) ? \AbraFlexi\RO::code($default) : $default)); } }