Problem/Motivation
When running ui_patterns_update_10203(), I am getting:
[warning] Undefined array key "pattern" ConfigurationConverter.php:614
[error] Drupal\ui_patterns_legacy\RenderableConverter::getNamespacedId(): Argument #1 ($component_id) must be of type string, null given, called in …/ui_patterns/modules/ui_patterns_legacy/src/ConfigurationConverter.php on line 615
[error] Update failed: ui_patterns_update_10203
Proposed resolution
Make the code robust against $legacySettings['pattern'] not being set.
Remaining tasks
Determine if this is the correct fix. Implement.
User interface changes
None.
API changes
None.
Data model changes
None.
Issue fork ui_patterns-3557208
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
liam morlandI have created a merge request with a plausible fix. I don't know if this is properly fixing it or just hiding the problem. This change does allow
ui_patterns_update_10203()and the following update hooks to run without error.Comment #4
grimreaperHi,
Thanks for your feedback on the config upgrade.
Can you please share the structure of the UIP1 config being updated?
To understand how this case can happen.
Comment #5
grimreaperHum, I think I know why you got the warning.
Are you upgrading a website from UIP1 to UIP2 or the website was already with UIP2 before the update?
Comment #6
grimreaperI think of a simple test to add is to ensure conversion is idempotent.
Comment #8
grimreaperComment #10
herved commentedI'm having a similar issue on a new project already on ui_patterns 2.0.10, it didn't even use ui_patterns 1.
But when applying composer update which gets ui_patterns 2.0.12, I see all the updates and it leaves ui_patterns_legacy enabled which I of course don't need.
I think all this should only run if we are actually coming from ui_patterns 1.x.
Comment #11
just_like_good_vibesHello, thank you for your help in reporting the problem, we will do a new release soon with the fix.
did you try the current dev version? does it fix the issue you described here?
thank you for your help
Comment #12
grimreaperHi,
Yes ui_patterns_legacy remains enabled at the end of the updates in case some code in Twig templates had not been updated because ui_patterns_legacy provides a compatibility layer at execution time too.
I also thought about that.
Either: add a message at the end of the updates
Or: add a settings in settings.php to allow to skip UIP1 config upgrade
Or: skip the updates if we can detect that an UIP2 module or feature is already present
Or: add a "marker" (state) in UIP1 with an update and tell to update from UIP1 from this version