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

Command icon 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

krisahil created an issue. See original summary.

krisahil’s picture

Status: Active » Needs review
krisahil’s picture

Assigned: krisahil » slucero
krisahil’s picture

Status: Needs review » Needs work

Moving 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.

krisahil’s picture

Issue summary: View changes
Status: Needs work » Needs review
slucero’s picture

The 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.

mariohernandez made their first commit to this issue’s fork.

mariohernandez’s picture

Status: Needs review » Fixed
Parent issue: » #3278420: Beta 4 release plan

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.