Closed (fixed)
Project:
Entity Browser
Version:
8.x-2.x-dev
Component:
Field widget
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Apr 2020 at 21:20 UTC
Updated:
2 Mar 2025 at 10:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
steveoriolComment #4
niral098Thanks @steveoriol. The above #2 patch works. But the patch has indentation errors. Adding a patch after solving those indentation errors.
Comment #5
niral098Fixed coding standards.
Comment #6
pnagornyak commentedPrevious patches breaks the code. It is showed by failed test. Uploading patch that should not break logic.
Comment #7
pnagornyak commentedComment #8
steveoriolOk, the patch #6 works for me ;-)
Comment #9
daggerhart commented#6 works. RTBC
It's the same bug as reported here in the 1.x version #2811747: Can't remove attached image.
Comment #10
berdirI have committed #3048530: EntityReferenceBrowserWidget::formElementEntities() incorrectly matches on wrong trigger element when not visible, I believe this is related if not a duplicate. Please retry with 8.x-2.x-dev and either close this or update the patch.
Comment #11
ahmed eldesoky commentedpatch #6 fails to apply on version 2.7
This is a 2.7 compatible version of patch #6
Comment #12
cbfannin commented#11 worked for me on v2.9
Added other related issues.
I would also add this is very strange. Before patching, our remove button worked fine on Pantheon Test environment. It only did not work on local, multidev, and dev environments. But after the patch, it now works on local, multidev, and dev.
Comment #13
cbfannin commentedComment #14
cbfannin commentedIn following up with the environments that the remove functionality works on vs those it does not work on, I realized it was because Devel is disabled on Test and Live but enabled on Dev and Local. As soon as I disabled Devel on my local and tried to remove the file from the field, the remove functionality worked.
This is without the patch being applied.
Comment #15
cbfannin commentedI did a clean install on simplytest.me with 8.x-2.9 and no longer seeing this issue.
My test steps were:
- Installed 8.x-2.9 (unpatched)
- Created a new Entity Browser adding the upload widget.
- Added an entity reference field to the page node type.
- Set the entity reference field's form display to Entity Browser.
- Created a new node.
- Selected an image with the new field.
- Saved the node.
- Edited the node.
- Clicked the "Removed" button.
Result: The image was removed with no reported errors.
Again this was a clean install with no patches.
If anyone wants to provide their test steps, I am more than happy to test again.
Comment #16
berdirSetting to needs work for steps to confirm what exactly causes this, also closed #3341527: Undefined array key on file remove as a duplicate.
Also should be a merge request now. Not against merging it as it shouldn't cause issues, but having steps to reproduce and preferably tests would make it easier to verify.
Comment #18
berdirComment #19
eduardo morales alberti@berdir as said in the comment #3247212-6: Ajax error on delete item
We are unsure how to cover it with tests, but the patch #3125117-11: Remove button in entity browser field widget doesn't work works for us.
Comment #20
eduardo morales albertiWe test it on a simpletestme https://master-cg4lcdtc1ja3gfni2izgajxkko4dkwxp.tugboatqa.com/
Steps to reproduce:
It is tested on a clean environment so RTBC
Full message error:
@berdir do you need more info?
Comment #23
andyf commentedI was also seeing this error on a node edit form with both a media browser and entity browser. The patch from #11 fixed it. I've moved it to an MR, still could do with tests.
Comment #24
andyf commentedLike #14 I'm finding it only actually breaks when devel's enabled; otherwise it generates the same warning but things carry on functioning.
And in case it's not clear, it's the media library widget that stops working for me (ie you can't remove the image), not the entity browser.
For me, with devel enabled and Error handlers set to None the PHP warning get prepended to the JSON responses preventing them from being parsed, it seems to be fixed with https://gitlab.com/drupalspoons/devel/-/merge_requests/149.
Comment #25
ahmed eldesoky commentedComment #26
ahmed eldesoky commentedComment #28
berdirMerged.