Undefined array key(s) in Drupal\ui_patterns\Plugin\Derivative\EntityFieldSourceDeriverBase

Created on 28 January 2025, 2 months ago

Problem/Motivation

I enabled ui patterns 2 on my site and get these errors
Warning: Undefined array key "entity_embed_fake_entity" in Drupal\ui_patterns\Plugin\Derivative\EntityFieldSourceDeriverBase->getEntityFieldsMetadata() (line 319 of modules/contrib/ui_patterns/src/Plugin/Derivative/EntityFieldSourceDeriverBase.php).

Warning: Undefined array key "field_storages" in Drupal\ui_patterns\Plugin\Derivative\EntityFieldSourceDeriverBase->getDerivativeDefinitionsForEntityFieldStorages() (line 411 of modules/contrib/ui_patterns/src/Plugin/Derivative/EntityFieldSourceDeriverBase.php).

Warning: foreach() argument must be of type array|object, null given in Drupal\ui_patterns\Plugin\Derivative\EntityFieldSourceDeriverBase->getDerivativeDefinitionsForEntityFieldStorages() (line 411 of modules/contrib/ui_patterns/src/Plugin/Derivative/EntityFieldSourceDeriverBase.php).

Warning: Undefined array key "label" in Drupal\ui_patterns\Plugin\Derivative\EntityFieldSourceDeriverBase->getDerivativeDefinitionsForEntityFieldStorages() (line 422 of modules/contrib/ui_patterns/src/Plugin/Derivative/EntityFieldSourceDeriverBase.php).

Warning: Undefined array key "metadata" in Drupal\ui_patterns\Plugin\Derivative\EntityFieldSourceDeriverBase->getDerivativeDefinitionsForEntityFieldStorages() (line 430 of modules/contrib/ui_patterns/src/Plugin/Derivative/EntityFieldSourceDeriverBase.php).

Warning: Undefined array key "properties" in Drupal\ui_patterns\Plugin\Derivative\EntityFieldSourceDeriverBase->getDerivativeDefinitionsForEntityFieldStorages() (line 442 of modules/contrib/ui_patterns/src/Plugin/Derivative/EntityFieldSourceDeriverBase.php).

Proposed resolution

Adding if isset on each one of them will solve the issue.

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇯🇴Jordan yasmeensalah

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