Problem/Motivation
When you run the Drush patternkit:libUpdate command, it ends with a fatal error:
TypeError: Argument 1 passed to Drupal\patternkit\Commands\PatternkitCommands::updateBlockComponentPluginPattern() must be an instance of Drupal\block\BlockInterface, instance of Drupal\layout_builder\SectionComponent given
Steps to reproduce
- On a vanilla Drupal 9 site with "standard" profile, install these modules: patternkit_example, layout_builder, and patternkit_media_library
- Enable Layout Builder for a node type.
- On the Layout page for one of those nodes, add a Patternkit block, e.g., the one labeled "[Patternkit] Example".
- Save the block and view it.
- Modify that pattern's Twig template (
modules/patternkit_example/lib/patternkit/src/atoms/example/src/example.twig). - Flush caches and reload your node page. Notice that the new markup is not showing.
- Run the command to re-load changed Pattern templates:
drush patternkit:libUpdate patternkit - Expect to get the error listed above.
Release notes snippet
- Fixed a bug to avoid a TypeError in patternkit:libUpdate Drush command.
- Removed argument library_name from that command because it is not used.
Issue fork patternkit-3284110
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
krisahil commentedComment #4
krisahil commentedComment #5
krisahil commentedMoving back to Needs work because we need to figure out how to run the library updater from a Drupal update hook.See https://www.drupal.org/project/patternkit/issues/3284744 for info about running the library updater from a Drupal update hook.
Comment #6
krisahil commentedComment #7
sluceroThe changes here look good to me, but if possible I'd like to hear from someone else running it to test as well.
This should be fine for a near-term fix to resolve the errors being thrown and get the command running again, but I would like to follow up this work with the changes proposed in #3284744 to make this functionality more accessible in more contexts.
Comment #10
mariohernandez commented