You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The table "nova_field_attachments" which is created by default has a big_int type for attachable_id. Which is fine for people using bigints on their models. But we use uuid's and that does not work. To find this error took a long time.
Detailed steps to reproduce the issue on a fresh Nova installation:
Clean installation
Create a model that uses uuid as primary key
Create a nova resource, which has a trix field
Upload a file
Try to save the model
Fails until you set the attachable_id type to uuid.
I can understand if you decide not to support this, but possible we could add a note to the docs saying that that needs to be taken into account?
Extra:
If the chosen route is to add it to the docs, maybe we could also add that the trix field needs to be available in the ->fields() method, not only in the ->fieldsForUpdate(). Otherwise the attachment does not upload at all to start with.
The text was updated successfully, but these errors were encountered:
Oh my gosh your last minute / extra comment at the end saved me. I've been debugging for hours trying to figure out why the file upload for Trix wasn't working, but I didn't realize it needed to be in the fields() method in addition to the fieldsForUpdate() or fieldsForCreate() methods if we extracted them out like that. I'm going to update my ticket.
Thanks for reporting this @rderks88 🙏
We've made according changes to the documentation, as you suggested, regarding the need for fields to contain all resources fields so we can ensure full functionality. Hopefully preventing others the surprise of non working fields.
Regarding the UUID part 👀
Nova migrations do follow Laravel's migration standards and therefore follow the $defaultMorphKeyType set for your application. As we encourage best practice of sticking with either one type of unique ID in an app, we won't be adjusting things around this area.
Rest is irrelevant.
Description:
The table "nova_field_attachments" which is created by default has a big_int type for attachable_id. Which is fine for people using bigints on their models. But we use uuid's and that does not work. To find this error took a long time.
Detailed steps to reproduce the issue on a fresh Nova installation:
Clean installation
Create a model that uses uuid as primary key
Create a nova resource, which has a trix field
Upload a file
Try to save the model
Fails until you set the attachable_id type to uuid.
I can understand if you decide not to support this, but possible we could add a note to the docs saying that that needs to be taken into account?
Extra:
If the chosen route is to add it to the docs, maybe we could also add that the trix field needs to be available in the ->fields() method, not only in the ->fieldsForUpdate(). Otherwise the attachment does not upload at all to start with.
The text was updated successfully, but these errors were encountered: