Skip to content

Conversation

@Berdir
Copy link
Contributor

@Berdir Berdir commented Oct 20, 2025

Description

Replacement of hooks that contain a dynamic part such as FORM_ID or ENTITY_TYPE currently don't work.

The problem is that it explicitly only replaces one section of uppercase characters with a regex, so it will try to match against an explicit ID or TYPE. Adding multiple dynamic sections wouldn't work either because the actual replacement might be just one part.

I suggest replacing the whole thing with a preg_replace() that finds any complete section of uppercase characters.

To Test

  • Run it on a module that has such a hook.

Drupal.org issue

There is no issue since this is a bugfix to an existing rule.

@nlighteneddesign
Copy link
Contributor

nlighteneddesign commented Oct 28, 2025

I tested this and this works!

Copy link
Contributor

@nlighteneddesign nlighteneddesign left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested locally with the metatag module and it works as expected

@bbrala bbrala merged commit 060403e into palantirnet:main Nov 7, 2025
1 check failed
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.

3 participants