Problem/Motivation
Hooks are not being triggered.
Proposed resolution
Move MetadataSanitizerHooks to the Drupal\metadata_sanitizer\Hook namespace, instead of Drupal\metadata_sanitizer\Hooks
Issue fork metadata_sanitizer-3570403
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
Comment #3
dieterholvoet commentedComment #4
zarabatana commentedThanks for MR !10 — the direction is correct (moving to src/Hook / Drupal\metadata_sanitizer\Hook and updating the service).
Two follow-ups needed before the merge:
The moved file currently has two namespace lines; please remove namespace Drupal\metadata_sanitizer\Hooks; so it only has namespace Drupal\metadata_sanitizer\Hook;.
Since the module supports Drupal 10, please add procedural shim hooks in metadata_sanitizer.module marked #[LegacyHook] that forward to the hook service (for hook_file_insert() and hook_help()), so hooks run on D10 and don’t double-run on D11.
Comment #5
dieterholvoet commentedI checked and there aren’t two namespace lines. We can add the fallback for older versions here, but it’s not really in scope for this bug fix. Feel free to do this yourself, not sure if I’ll find the time in the coming weeks.
Comment #6
dieterholvoet commentedComment #7
zarabatana commentedThanks! MR !10 correctly moves the hook implementation into src/Hook (Drupal\metadata_sanitizer\Hook), so it’s discovered and executed as expected, and the services.yml update follows suit. I’m marking RTBC and proceeding to merge.
Comment #8
zarabatana commentedMR !10 is now merged. This moves the hook implementation to src/Hook (Drupal\metadata_sanitizer\Hook) so it’s correctly discovered/executed. Marking this issue fixed/closed.
Comment #10
zarabatana commented