Error when trying to edit an existing geo entity in an entity browser

Created on 27 September 2023, over 1 year ago
Updated 18 February 2024, 11 months ago

Problem/Motivation

This was encountered during the upgrade to the Localgov Drupal distribution which now uses Geo entity, but I belive will effect all instances that use the Geo entitiy browser.

Once a geo is selected, it is not possible to edit that geo on the node it is embeded.
Instead a error "Please see the console" which shows the ajax error, and the logs show.

Error: [] operator not supported for strings in Drupal\entity_browser\Controllers\EntityBrowserController->entityBrowserEdit() (line 75 of /app/web/modules/contrib/entity_browser/src/Controllers/EntityBrowserController.php).

Looking at .module geo_entity is attempting to a JS library as just a string and not part of an array.
$complete_form['#attached']['library'] = 'geo_entity/geocode-geofield';
Changing that to an array solves the issue.

Steps to reproduce

Add an geo entity reference to a node and use the geo entitiy browser widget.
Add a geo to a node and save.
Edit the node and try to edit the geo.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom andybroomfield

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

Comments & Activities

Production build 0.71.5 2024