Problem/Motivation

When you have an annotation to register multiple hooks for one preprocessor plugin class, the equality check fails.

/**
 * Preprocessor for handling paragraph hero types.
 *
 * @Preprocess(
 *   id = "my_module.paragraph.hero",
 *   hook = {
 *     "paragraph__hero",
 *     "paragraph__banner",
 *   },
 * )
 */

I'm in the middle of a D10 to D11 migration and this project did this a few times. Maybe it doesn't match the intent of the module, :shrug:. I believe the themespace module in D10 may have allowed for this. Not sure. We were able to fix related issues by upgrading this module and changing a few namespaces. We also had the issue where this module only finds the classes if there is a template and that affects the same logic I believe.

I'm leaving this here in case anyone finds it useful. I don't check drupal.org much these days.

This patch was written with the help of Claude Code, but I validated it and wrote everything in this summary.

Steps to reproduce

Create one plugin class for multiple hooks.

Proposed resolution

Handle arrays in the equality check.

Remaining tasks

User interface changes

n/a

API changes

n/a

Data model changes

n/a

Comments

damontgomery created an issue.