Skip to content

Commit 7af5fae

Browse files
authored
Merge pull request #133 from RomkaLTU/fix-possible-empty-string
Fix cast issue in TranslatableFieldMixin
2 parents 3f40b38 + f1b155a commit 7af5fae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/TranslatableFieldMixin.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function translatable()
7676
: config('nova-translatable.fill_other_locales_from', null);
7777

7878
// Fix strings being casted to floats
79-
if ($this instanceof Text && !$this instanceof Number) {
79+
if ($this instanceof Text && !$this instanceof Number && !empty($value)) {
8080
foreach ($value as $key => $val) {
8181
$value[$key] = ($val === null ? null : (string) $val);
8282
}

0 commit comments

Comments
 (0)