outl1ne / nova-simple-repeatable

A Laravel Nova simple repeatable rows field.
MIT License
73 stars 42 forks source link

Validation Errors Issue #14

Closed 29avet1 closed 3 years ago

29avet1 commented 3 years ago

When you have roles attached to SimpleRepeatable Field anf you get a validation error that DOES NOT related to SimpleRepeatable filed, then you get an error

image

TypeError: Cannot read property '0' of null Seems in case we have validation error, it tries to get first validation error. but as that validation error belongs to another filed, it tries to get first item from NULL, and that brakes the JS code. In this case Sorting and "Add Row" don't work anymore, and also the data can't be saved anymore, even when validation error is fixed.

29avet1 commented 3 years ago

Update: I checked and it returns a JSON string, my validation was set to expect an Array, that's why it was broken. But still there is an issue that Validation error "Extensions field must be an Array" is not shown here.

Tarpsvo commented 3 years ago

Heya! There was indeed an issue with validation keys parsing. It is now fixed in release 1.3.0. Do give it a try! Thanks for reporting this and good luck!