Notice: "Undefined index: view_mode" & "Undefined variable: noTokenMessage"

Created on 5 August 2022, over 2 years ago
Updated 15 February 2024, 9 months ago

Problem/Motivation

Notice: Undefined index: view_mode in Drupal\mapbox_field\Plugin\Field\FieldWidget\MapboxWidget::create() (line 53 of modules\contrib\mapbox_field\src\Plugin\Field\FieldWidget\MapboxWidget.php).
Drupal\mapbox_field\Plugin\Field\FieldWidget\MapboxWidget::create(Object, Array, 'mapbox_widget', Array) (Line: 122)
Notice: Undefined variable: noTokenMessage in Drupal\mapbox_field\Plugin\Field\FieldWidget\MapboxWidget->formElement() (line 220 of modules\contrib\mapbox_field\src\Plugin\Field\FieldWidget\MapboxWidget.php).
Drupal\mapbox_field\Plugin\Field\FieldWidget\MapboxWidget->formElement(Object, 0, Array, Array, Object) (Line: 353)

Steps to reproduce

1. Install and enable module
2. Create a field with type "Mapbox"
3. You'll see the notice on the "edit" page as well as on the data entry page where this field is used

Proposed resolution

Fix the undefined index notices.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

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

Merge Requests

Comments & Activities

Not all content is available!

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

Production build 0.71.5 2024