Undefined array key "label"

Created on 7 October 2023, about 1 year ago
Updated 11 October 2023, about 1 year ago

Problem/Motivation

There is logged the following error in the Drupal Reports page:
Warning: Undefined array key "label" in Drupal\entity_display_json\Controller\EntityDisplayJsonController->processEntity() (line 150 of /modules/contrib/entity_display_json/src/Controller/EntityDisplayJsonController.php)

Steps to reproduce:

1. Ensure the Links core field is visible in the Default view mode of any content type.

2. Navigate to the endpoint of the node of the same content type above using the /ejson/node/ path and you will see there is no label key.

3. Check the Drupal Logs page and you will see the following error:
Warning: Undefined array key "label" in Drupal\entity_display_json\Controller\EntityDisplayJsonController->processEntity() (line 150 of /modules/contrib/entity_display_json/src/Controller/EntityDisplayJsonController.php)

Proposed resolution:

Validate whether or not the label key exists in the $field_value array at the line 150.

User interface changes:

No

API changes:

No

Data model changes:

No

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇨🇴Colombia carma03

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

Comments & Activities

Production build 0.71.5 2024