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.
Issue fork ui_patterns-3502916
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
just_like_good_vibesHello,
thank you for reporting you error.
Would you share with us, the list of enabled contrib and core modules please?
from the trace, i may guess "entity_embed"?
many thanks in advance
Comment #3
nidhish commented@yasmeensalah, Could you mention the drupal version on which you are getting the following issues?
Comment #4
yasmeensalah commentedHi,
answering @just_like_good_vibes:
Yes i have entity_embed, and most probably it's causing both errors
@nidhish
I have Drupal 10.4.1. , after updating ui-patterns to 2.0.0-rc2 most of the issues have been resolved (all issues listed here https://www.drupal.org/project/ui_patterns/issues/3498456)
Only 2 things are left (filed storage line 416) and (entity_embed_fake_entity line 322)
Comment #5
just_like_good_vibesHello @yasmeensalah,
thanks, i will try to reproduce and post the correction
Comment #7
just_like_good_vibesComment #8
just_like_good_vibesComment #10
just_like_good_vibesComment #11
steveoriolYes, the changes correct the problem I have on 2.0.0-rc2
Great, thanks!
Comment #12
pdureau commented