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.
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 thenova_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.