- πΊπΈUnited States nicxvan
Well, hook_hook_info is now deprecated is there another way to do this?
#2866779: Add a way to trigger_error() for deprecated hooks β added ways to mark hooks deprecated by introducing new API methods. This means we needed one new API method for every method hooks can be invoked, adding three new methods for one small purpose, as well as putting the deprecation burden not on the hook owner, but the owner of every single invocation of deprecated hooks, and while we tend to wrap hook invocations in their own API methods, invoking hooks without API wrappers used to be common practice for a long time.
We can deprecate these three ::*Deprecated()
methods and put the burden of deprecation solely with hook owners by marking hooks deprecated in hook_hook_info()
implementations:
Before Drupal 8.7:
\Drupal::moduleHandler()->invokeDeprecated('foo_bar');
Drupal 8.7:
function foo_hook_info() {
return [
'foo_bar' => [
'deprecated' => 'hook_foobar() has been deprecated since Drupal 8.7. Use hook_foo_baz() instead. See https://drupal.org/node/foo_bar',
],
]
}
ModuleHandler::getImplementations()
will trigger errors for any implementations of deprecated hooks.
None.
ModuleHandlerInterface::*Deprecated()
will become deprecated.
One optional addition to hook_hook_info()
's return value.
Needs work
11.0 π₯
extension system
A change record needs to be drafted before an issue is committed. Note: Change records used to be called change notifications.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Well, hook_hook_info is now deprecated is there another way to do this?