Skip to content

Make the five always-on legacy rules configurable and fix a wrong error identifier - #1029

Draft
mglaman wants to merge 1 commit into
audit/3-modernizationfrom
audit/4-bc-changes
Draft

Make the five always-on legacy rules configurable and fix a wrong error identifier#1029
mglaman wants to merge 1 commit into
audit/3-modernizationfrom
audit/4-bc-changes

Conversation

@mglaman

@mglaman mglaman commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Part 8 of 9 in the legacy-code audit stack (on top of #1028). Two changes that deserve release-note visibility.

What changed

Five always-on rules become configurable. DiscouragedFunctionsRule, GlobalDrupalDependencyInjectionRule, PluginManagerSetsCacheBackendRule, ModuleLoadInclude, and LoadIncludes move from the flat rules: block to the conditionalTags registration every newer rule uses, gated on new drupal.rules.* parameters. They default to true, so nothing changes for existing users — they gain a per-rule opt-out, documented in the README.

Wrong error identifier fixed. The "%s must override __construct if using YAML plugins." message in PluginManagerInspectionRule was reported under pluginManagerInspection.callAlterInfo, which belongs to a different check. It is now pluginManagerInspection.constructorOverrideMissing.

Upgrade note

Anyone with an ignoreErrors entry targeting pluginManagerInspection.callAlterInfo for the constructor-override message needs to switch to the new identifier.

Testing

Full suite, self-analysis, and phpcs are green.

🤖 Generated with Claude Code

…or identifier

DiscouragedFunctionsRule, GlobalDrupalDependencyInjectionRule,
PluginManagerSetsCacheBackendRule, ModuleLoadInclude, and LoadIncludes
move from the flat rules: block to the conditionalTags registration all
newer rules use, gated on new drupal.rules.* parameters that default to
true. Behavior is unchanged; consumers gain a per-rule opt-out.

The 'must override __construct' message in PluginManagerInspectionRule
was reported under pluginManagerInspection.callAlterInfo, which belongs
to a different check. It is now
pluginManagerInspection.constructorOverrideMissing. Anyone ignoring the
old identifier for this message must update their configuration.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mglaman
mglaman force-pushed the audit/4-bc-changes branch from 4843df6 to 54ac02c Compare August 5, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant