laravel / nova-issues

554 stars 34 forks source link

Trix field does not purge pending field attachments and adding it to the content. #6467

Closed albertcat closed 3 months ago

albertcat commented 4 months ago

Description:

When adding and attachment on a Trix field, it is correctly inserted on the nova_pending_field_attachments table via the API. But if you do not save the page and discard the attachment (remove it from the Trix field using the X button) and then save the content of the field, the attachment is not deleted form the pending table and it is transferred to the nova_fields_attachment table, even though it was removed from the field. This leaves the database in an unconsistent state.

I think the problem is that when removing the attachment, the Trix field uses the same DELETE call to remove the attachment regardless if the attachment is a draft or not. Meaning that removing a draft attachment will never call the correct endpoint to purge the pending_attachments table.

github-actions[bot] commented 3 months ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.