Problem/Motivation

Trying to update all existing component using a specific library gets ignored.

Steps to reproduce

In the patterns table, my library is patternKit
In my patternkit_field_data my pattern_id is *@patternKit/layouts/band/band*
Running the folllowing command
drush pklu @pattternKit node.page.default
It will process 0 due to the following due to the following condition
https://git.drupalcode.org/project/patternkit/-/blob/9.1.0-beta6/src/Upd...

// Don't update patterns outside the indicated library if provided.
    if ($library_name && $pattern->getLibrary() !== $library_name) {
      return FALSE;
    }

Where $library_name is @patternKit but $pattern->getLibrary() is patternKit
Even with the following will also failed the condition
drush pklu pattternKit node.page.default
due to the first condition check https://git.drupalcode.org/project/patternkit/-/blob/9.1.0-beta6/src/Upd...

Proposed resolution

Update the condition so that works with *@libraryname* as the example given in the drush command.

Remaining tasks

Update the logic in UpdateHelper->updateBlockComponentPattern().

User interface changes

None

API changes

None

Data model changes

None

Issue fork patternkit-3333342

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

johnle created an issue. See original summary.

johnle’s picture

Title: passing in » The library filter does not work in using drush pklu / patternkit-lib-update
Issue tags: -The library filter does not work in using drush pklu / patternkit-lib-update

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

slucero’s picture

Status: Active » Needs review
johnle’s picture

Version: 9.1.0-beta6 » 9.1.x-dev
johnle’s picture

Status: Needs review » Fixed

Tested this against the dev branch and that is now working.

  • slucero committed 1a3099e4 on 9.1.x
    Issue #3333342 by slucero: The library filter does not work in using...
slucero’s picture

Status: Fixed » Closed (fixed)

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