Problem/Motivation
There are only a few remaining procedural hooks.
Four of them are called from ModuleInstaller.
Let's provide class replacements similar to #3623380: Create OOP replacement for hook_install_tasks and hook_install_tasks_alter
- hook_uninstall
- hook_install
- hook_update_last_removed
- hook_schema
Steps to reproduce
Open module installer.
Proposed resolution
Create interfaces for the four hooks.
Call the hooks and fallback to procedural.
Remaining tasks
What do we call these former hooks?
Review
Add follow up for conversion
Add deprecation follow up for the procedural fall back@trigger_error("Procedural hook_{$hook}() is deprecated in drupal:12.1.0 and is removed from drupal:13.0.0. Use the class replacements instead. See https://www.drupal.org/node/3633696', E_USER_DEPRECATED);
User interface changes
Introduced terminology
API changes
- hook_uninstall is replaced by UninstallInterface
- hook_install is replaced by InstallInterface
- hook_update_last_removed is replaced by LastRemovedInterface
- hook_schemais replaced by SchemaInterface
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|
Issue fork drupal-3633695
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 #4
nicxvan commentedComment #5
nicxvan commentedComment #6
nicxvan commentedComment #7
nicxvan commentedI think we need to come up with a new name for these after adding these will have 7.
Comment #8
nicxvan commentedThe failures are random, they pass locally.
This should be ready for review!
Comment #9
nicxvan commentedDocumentation needs updates.
Comment #10
nicxvan commentedI updated the comments, this should be ready.
Comment #11
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #12
nicxvan commented