Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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),
];
Comment | File | Size | Author |
---|---|---|---|
#3 | 2911572-3-demo-widget-controller-fixes.patch | 1.87 KB | ChristianAdamski |
| |||
geolocation-fix-demo-widget-forms-controller.patch | 709 bytes | mythodea | |
Comments
Comment #2
mythodea CreditAttribution: mythodea commentedComment #3
ChristianAdamski CreditAttribution: ChristianAdamski at Wolters Kluwer commentedSlightly altered this + fix for https://www.drupal.org/node/2443815 (maybe introduced by D8.4?)
Comment #5
ChristianAdamski CreditAttribution: ChristianAdamski at Wolters Kluwer commentedThanks!