Overview

In writing #3485233-24: Add phpstan-baseline Composer script to root composer.json, I looked at our PHPStan baseline/ignores. It includes:

		-
			message: '#^Attribute class Drupal\\Core\\Hook\\Attribute\\LegacyRequirementsHook does not exist\.$#'
			identifier: attribute.notFound
			count: 1
			path: canvas.install

… which felt kinda off to see in there.

This was introduced in #3561392: Test Canvas on Drupal 11.3, ~2.5 months ago, to get Canvas to pass tests/CI on 11.3. It seems innocent, right?

🐲 However, reading the docblock for LegacyRequirementsHook:

 * Marking requirements hooks as #LegacyRequirementsHook will prevent them
 * from running on Drupal 11.3.0 and later.

Manually tested and … sure enough, our requirements hook does not fire on >=11.3!

Proposed resolution

Make it run again.

User interface changes

Issue fork canvas-3587539

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

wim leers created an issue. See original summary.

wim leers’s picture

Issue summary: View changes
Status: Active » Needs review
wim leers’s picture

Wow, looks like this was simply … unnecessary 😅

wim leers’s picture

Assigned: wim leers » Unassigned
penyaskito’s picture

Status: Needs review » Needs work

If we can ensure all are converted already, we should be using

parameters:
  canvas.skip_procedural_hook_scan: true

(see https://www.drupal.org/node/3498595)

wim leers’s picture

Status: Needs work » Needs review
Related issues: +#3588641: Follow core's #3498595 CR and OOPify in Canvas

Discussed this with @penyaskito; that CR should indeed be implemented by Canvas, but is not actually the scope here. The scope here is to ensure hook_requirements() actually works on 11.3.

For #6, we opened #3588641: Follow core's #3498595 CR and OOPify in Canvas.

penyaskito’s picture

Status: Needs review » Fixed

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.

penyaskito’s picture