- 🇺🇸United States cbfannin
#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.
- Status changed to RTBC
over 1 year ago 10:19pm 21 March 2023 - 🇺🇸United States cbfannin
In following up with the environments that the remove functionality works on vs those it does not work on, I realized it works when Devel is disabled on Test and Live environments on Pantheon. The remove functionality does not work when Devel is 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.
- 🇺🇸United States cbfannin
I 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. - 🇨🇭Switzerland berdir Switzerland
Setting to needs work for steps to confirm what exactly causes this, also closed 🐛 Undefined array key on file remove Closed: duplicate 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.
- Status changed to Needs work
4 months ago 3:28pm 10 August 2024 - 🇪🇸Spain eduardo morales alberti Spain, 🇪🇺
@berdir as said in the comment #3247212-6: Ajax error on delete item →
We're seeing the same issue. It doesn't actually cause a problem unless PHP has the display_errors option switched on.
Here the problem is caused by having both an Entity Browser field and a core Media Library field on the same form. When trying to remove an item from the media widget, the Entity Browser code is getting confused because the button for core Media Library is also called remove_button
Attaching patch which checks the field name on the triggering element matches the expected one for this widget. This allows both the media library and entity browser to function correctly again here.
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.
- 🇪🇸Spain eduardo morales alberti Spain, 🇪🇺
We test it on a simpletestme https://master-cg4lcdtc1ja3gfni2izgajxkko4dkwxp.tugboatqa.com/
Steps to reproduce:
- We installed the drupal 10.3.9
- Installed the entity browser and created a reference field to content with this widget
- Installed media and media library
- Created a content with a media and saved the content
- Edit again the content and remove the media
- Review the logs
It is tested on a clean environment so RTBC
@berdir do you need more info?