- Issue created by @geek-merlin
- Status changed to Postponed: needs info
4 months ago 8:25am 8 September 2024 - 🇦🇺Australia dpi Perth, Australia
These are of course implementation details, and perhaps also class misuse of terminology in Drupal-land.
But an alter isn't a hook. Alters are called differently to hooks.
I have also seen in rare cases where some hook was named with a _alter suffix, but called using the hook/invoke code path. Which would in Hux' case require you to use #[Hook] attribute. Leaving to even more #dxwtf.
Re,
[Hook] does not work as expected [Alter]
I think thats just something you get used to during learning about Hux. There is a clear delineation between hook and alter. Otherwise the design of Hux would just have one universal/multi-use Hook attribute.
I think at best for this issue, I'd consider a trigger_error or something when __constructing a #[Hook] instance, looking for str_ends_with(_alter), so at least you'd be able to patch things and deal with modules which are misbehaving w MH->invoke/alter.
Let me know your thoughts, but for now my thinking is wontfix.