Closed neildcuk closed 3 years ago
Interestingly, I just managed to resolve the unrelated errors on a required BelongsTo relation field by adding that field to the resource so it can be filled in before saving.
The issue with the enum field has oddly vanished, and it will now submit and store the value correctly on creation of a new entity.
I believe this is resolved but leaving this here in case you want to look into why Nova would highlight your field as required when another, unrelated field referencing a constrained relationship is missing from the resource.
Interesting! Glad you got it working though, @neilwhitespace 😄 I will try check it out this weekend and see if I can replicate the issue.
I haven't been able to make headway with this, so I'm closing for now. If anyone else runs into this issue, I will look into it again.
Not a problem—as I've said, we worked around it by providing complete validation anyway, so definitely an edge case!
Hi there — bit of an odd one. We're having trouble changing the enum values in existing records, and submitting the form on a new record.
There's about 5 or 6 enums in the project but one Model only has one so that'll be my example.
Enum:
Relevant bits of the Model:
Resource:
The select appears on the resource correctly and it shows all of the possible enum values. I've checked it also has
value
attributes which match the property values too.It seems that whatever I put in the value of the select, when I hit submit, it states the field is required.
When I had other errors appear due to a missing relation on an unrelated field, I did notice that Nova was attempting to insert the chosen value into the DB as well, so not sure what might be happening here.
I've also checked your code here:
And dumping
$request[$requestAttribute]
comes back with the value as selected.Any ideas? Any suggestions would be gratefully received!