I use this widget in a custom entity in a "field_file" field.
I add a custom validation on this entity, which requires to have only one field between field_file and field_url (link field) to be set.
With both fields set, when I want to remove the referenced entity, it triggers and violates the entity constraint and does not remove the reference.

Comments

SylvainM created an issue. See original summary.

sylvainm’s picture

Status: Active » Needs review
StatusFileSize
new855 bytes

I fixed the issue with this patch, what do you think about?

slashrsm’s picture

Status: Needs review » Needs work
Issue tags: +D8Media

This won't work as now removeItemSubmit() can't get to the list of entities. This results in all entities being removed, not just the one that button was pressed for.

It would be optimal if we could find a way to disable entity constraints for this submit.

DeFr’s picture

Status: Needs work » Needs review
StatusFileSize
new934 bytes

Different approach, that one should work better. No interdiff, because the patch is a complete reboot.

  • slashrsm committed 18ef995 on 8.x-1.x authored by DeFr
    Issue #2747853 by SylvainM, DeFr, slashrsm: Widget remove button...
slashrsm’s picture

Status: Needs review » Fixed

Committed. Thanks!

slashrsm’s picture

Committed. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.