- 🇨🇭Switzerland berdir Switzerland
Related issues: ✨ hook_event_dispatcher compatability Active and 📌 Support CronSubscribers Active (and the related core issue).
Interesting solution but it's trying to be a little bit too generic I think. Whether or not something is/has certain hook is just a naming convention, with that logic, any module-prefixed callback is going to be recognized as a hook.
Instead, we should do this only if it the cron hook. Meaning, isCallbackHook() should just check $this->getHookName() === 'cron', at this point we can of need to expect that it exists.
Hopefully, the long-term solution is the core issue that I created to make cron tasks/jobs their own thing that can be discovered and not hooks. Feedback/reviews there would definitely be welcome.
- Status changed to Closed: duplicate
4 months ago 7:26am 24 November 2024 - 🇨🇭Switzerland berdir Switzerland
Drupal 11.1 now has #Hook, implemented something quite similar to this in 📌 Fix 11.1 test fails Active including a new special syntax instead of assuming based on the function name, that would have worked too I guess, forgot about this issue actually.