Problem/Motivation
When enabling this module with our Dripyard themes, we're getting the following warning on components that don't provide a schema (should be optional)
Warning: Undefined array key "name" in Drupal\ui_patterns\ComponentPluginManager->processDefinitionCategory() (line 151 of /var/www/html/web/modules/contrib/ui_patterns/src/ComponentPluginManager.php)
Steps to reproduce
Add a component with no schema. Clear cache, see the warning.
Proposed resolution
Follow what processDefinitionCategory does with no `name` is available.
Issue fork ui_patterns-3550802
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 #3
andyg5000Comment #6
just_like_good_vibesDear andyg5000,
thank you for reporting.
As already mentioned in the code, sdc component definitions without names is not a good practice, and those changes would rather being made directly to the mentioned themes.
But to support those practices in the wild, i have just updated the code :)
Note that there was already a line of code to cope with definition's names missing , but it seems that in your use case
processDefinitionCategorywas called without a prior call toprocessDefinition, seems strange to me but anyway i have added this new check and factorize the existing behavior inside a new protected method "cleanDefinition" instead of duplicating it in processDefinition and processDefinitionCategory.MR to review is [!448]
Comment #8
pdureau commentedComment #10
just_like_good_vibes