Can't remove attached image

Created on 5 October 2016, about 8 years ago
Updated 14 July 2024, 4 months ago

Using latest dev version (released today 2016-Oct-05), however I think this error started before today's release.

Attempting to remove images using the Remove button now generates an ajax error and logs the following:

Notice: Undefined offset: -1 in Drupal\entity_browser\Plugin\Field\FieldWidget\EntityReferenceBrowserWidget->formElementEntities() (line 614 of /modules/contrib/entity_browser/src/Plugin/Field/FieldWidget/EntityReferenceBrowserWidget.php).

Thanks @joshua for providing a patch!

πŸ› Bug report
Status

Needs work

Version

2.0

Component

Widget plugins

Created by

πŸ‡¬πŸ‡§United Kingdom glynnr

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States cbfannin
  • Status changed to RTBC 5 months ago
  • πŸ‡ͺπŸ‡ΈSpain isholgueras

    Patch #12 works for me too

  • Status changed to Needs work 4 months ago
  • πŸ‡¨πŸ‡­Switzerland berdir Switzerland

    Still unclear how to commit this, but all contributions must be done as MR now so that tests can run.

  • πŸ‡ΊπŸ‡ΈUnited States cbfannin

    I did a clean install on simplytest.me with 8.x-2.x-dev and not seeing this issue.

    My test steps were:
    - Installed 8.x-2.x-dev (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.

Production build 0.71.5 2024