Undefined function drupal_get_path error on ECK mapbox field edit page

Created on 15 June 2023, over 1 year ago
Updated 15 February 2024, 9 months ago

Problem/Motivation

I added the mapbox field to a ECK bundle. When I attempt to edit it I get the following error:

The website encountered an unexpected error. Please try again later.

Error: Call to undefined function Drupal\mapbox_field\Plugin\Field\FieldWidget\drupal_get_path() in Drupal\mapbox_field\Plugin\Field\FieldWidget\MapboxWidget->formElement() (line 83 of modules/contrib/mapbox_field/src/Plugin/Field/FieldWidget/MapboxWidget.php).
Drupal\Core\Field\WidgetBase->formSingleElement() (Line: 216)
Drupal\Core\Field\WidgetBase->formMultipleElements() (Line: 111)
Drupal\Core\Field\WidgetBase->form() (Line: 287)
Drupal\Core\Field\FieldItemList->defaultValuesForm() (Line: 125)
Drupal\field_ui\Form\FieldConfigEditForm->form() (Line: 106)
Drupal\Core\Entity\EntityForm->buildForm()
call_user_func_array() (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 283)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 163)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 686)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Steps to reproduce

Fresh Drupal 10 install
composer require 'drupal/mapbox_field:^1.0'
drush en mapbox
drush en mapbox_field
Go into Mapbox and configure it with API token and the mapbox style and click save.
* Go to the structure for a Basic Page
* Click on manage fields
* Add a mapbox field
* Set storage settings to 1 and save
* Click on Edit for the map box field.

Proposed resolution

* Update the code so the error doesn't happen.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇦🇺Australia jaime@gingerrobot.com

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024