Skip to content

Commit

Permalink
Merge pull request #133 from RomkaLTU/fix-possible-empty-string
Browse files Browse the repository at this point in the history
Fix cast issue in TranslatableFieldMixin
  • Loading branch information
KasparRosin authored Sep 12, 2024
2 parents 3f40b38 + f1b155a commit 7af5fae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/TranslatableFieldMixin.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function translatable()
: config('nova-translatable.fill_other_locales_from', null);

// Fix strings being casted to floats
if ($this instanceof Text && !$this instanceof Number) {
if ($this instanceof Text && !$this instanceof Number && !empty($value)) {
foreach ($value as $key => $val) {
$value[$key] = ($val === null ? null : (string) $val);
}
Expand Down

0 comments on commit 7af5fae

Please sign in to comment.