undefined property $entityFormDisplay in EventForm

Created on 14 November 2023, about 1 year ago
Updated 3 April 2024, 8 months ago

Problem/Motivation

I get the following error when trying to open a specific event for editing (e.g. /admin/bat/events/event/453/edit)

Warning: Undefined property: Drupal\bat_event\Entity\Form\EventForm::$entityFormDisplay in Drupal\bat_event\Entity\Form\EventForm->buildForm() 

This seems to relate to an update done to the code a few days ago, where for some reason the line at row 145 was changed to use $this->entityFormDisplay->load(), even though there does not seem to be a property called entityFormDisplay anywhere in the class hierarchy.

Proposed resolution

Revert code back to use EntityFormDisplay::load($entity->getEntityTypeId() . '.' . $entity->bundle() . '.' . $form_state->getStorage()['form_display']->getMode()).

🐛 Bug report
Status

Closed: outdated

Version

2.1

Component

Code

Created by

🇫🇮Finland jwwj

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

Comments & Activities

Production build 0.71.5 2024