Skip to content

Commit

Permalink
Fix optional relations trying to store empty value when using csv
Browse files Browse the repository at this point in the history
  • Loading branch information
Toflar committed May 22, 2024
1 parent 50ccfc0 commit 2b647dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DcaRelationsManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function updateRelatedRecords(mixed $value, DataContainer $dc): mixed

// Support for csv values
if (($field['eval']['multiple'] ?? false) && ($field['eval']['csv'] ?? false)) {
$values = explode($field['eval']['csv'], (string) $value);
$values = !$value ? [] : explode($field['eval']['csv'], $value);
} else {
$values = StringUtil::deserialize($value, true);
}
Expand Down

0 comments on commit 2b647dc

Please sign in to comment.