In the Geolocation - Demo module the route /geolocation-demo/widgets returns the following error:

Notice: Undefined index: #title in Drupal\geolocation\Plugin\Field\FieldWidget\GeolocationGooglegeocoderWidget->formElement() (line 445 of modules/contrib/geolocation/src/Plugin/Field/FieldWidget/GeolocationGooglegeocoderWidget.php).

Problem/Motivation

Install the Geolocation - Demo module and hit the following route YOUR-DOMAIN/geolocation-demo/widgets

Proposed resolution

Find the DemoWidgetFormsController and replace the lines 93 to 97 :

      $form[$widget_id] = [
        '#type' => 'fieldset',
        '#title' => $widget->getPluginDefinition()['label'],
        'widget' => $widget->formElement($items, 0, [], $form, $form_state),
      ];

with the following :

      $form[$widget_id] = [
        '#type' => 'fieldset',
        'widget' => $widget->formElement($items, 0, ['#title' => $widget->getPluginDefinition()['label']], $form, $form_state),
      ];
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mythodea created an issue. See original summary.

mythodea’s picture

Status: Fixed » Needs review
ChristianAdamski’s picture

Slightly altered this + fix for https://www.drupal.org/node/2443815 (maybe introduced by D8.4?)

ChristianAdamski’s picture

Status: Needs review » Fixed

Thanks!

Status: Fixed » Closed (fixed)

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