Problem/Motivation

/admin/reports/status suppresses the reusable Patternkit blocks deprecation warning when enable_reusable_blocks: true is set in services.yml. The enable_reusable_blocks flag was introduced in Patternkit 9.1.2 as part of the original reusable block deprecation and is available in 9.1.3 as a migration window for sites that need more time before the 9.2.0 removal ([#3587714]). The early-return guard in ReusableBlockHooks::requirements() treated an explicit opt-in as evidence of awareness and skipped the warning. Operators who enabled the flag to buy time saw no prompt to complete migration and had no visible deadline for doing so.

Steps to reproduce

  1. Install Patternkit 9.1.3 on a site that has existing reusable Patternkit blocks stored in patternkit_field_data.
  2. Add the following to services.yml and rebuild the cache:

    patternkit.config:
      features:
        enable_reusable_blocks: true
  3. Navigate to /admin/reports/status.
  4. Observe: no "Reusable Patternkit blocks are deprecated" warning appears, even though reusable blocks exist in the database.

Expected behavior

The deprecation warning appears on /admin/reports/status whenever reusable blocks exist in patternkit_field_data, regardless of whether enable_reusable_blocks is enabled or disabled.

Actual behavior

When enable_reusable_blocks: true is set, ReusableBlockHooks::requirements() returns early and the warning is never added to the status report. Operators relying on the flag as a migration aid receive a false negative: the site appears clean in the status report while deprecated content remains.

Proposed resolution

Remove the six-line early-return guard in ReusableBlockHooks::requirements() that skips the deprecation check when enable_reusable_blocks is enabled. The query against patternkit_field_data now runs unconditionally.

Update the warning description to include a direct link to #3587730: Remove reusable block support in 9.2.0 with migration tooling (the 9.2.0 removal issue) so operators have a concrete reference for the removal timeline and migration tooling.

Changed files

  • src/Hook/ReusableBlockHooks.php: removed the early-return guard. Added Link and Url class imports. Updated the warning description to include the removal issue link.
  • tests/src/Kernel/ReusableBlockHooksRequirementsTest.php: replaced the test asserting suppressed behavior with a test asserting the warning appears when the flag is enabled and blocks exist. Added an assertion for the removal issue link and a variant covering flag-enabled with no blocks present (no warning expected).

Remaining tasks

  • Review and test the merge request.
  • CI validation.

User interface changes

The deprecation warning on /admin/reports/status now includes a link to the 9.2.0 removal issue (#3587730: Remove reusable block support in 9.2.0 with migration tooling) regardless of the enable_reusable_blocks flag state.

Introduced terminology

None.

API changes

None.

Data model changes

None.

Release notes snippet

The enable_reusable_blocks feature flag was introduced in Patternkit 9.1.2 as part of the original reusable block deprecation and is available in 9.1.3 as an explicit migration window before the 9.2.0 removal (#3587714: Revert Reusable Block Support Removal Until Later Release). A logic error caused /admin/reports/status to suppress the deprecation warning when that flag was enabled, leaving operators with no visible prompt to complete migration. This fix removes the suppression so the warning appears whenever reusable blocks exist in the database, regardless of flag state. The warning description now links directly to the removal issue (#3587730: Remove reusable block support in 9.2.0 with migration tooling) for tracking the 9.2.0 deadline.

Issue fork patternkit-3615303

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

slucero created an issue. See original summary.

slucero’s picture

Status: Active » Needs review

Ready for testing on the MR.

  • slucero committed b00d90ad on 9.1.x
    fix: #3615303 Always show reusable blocks deprecation warning when...
slucero’s picture

Status: Needs review » Fixed

Merged for inclusion in release 1.3.
See #3542304: Patternkit 9.1.3 Release Plan.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.