Problem/Motivation
#3066801: Add hook_removed_post_updates() is adding a hook with the following example implementation in the API docs:
+++ b/core/lib/Drupal/Core/Extension/module.api.php
@@ -763,6 +764,30 @@ function hook_post_update_NAME(&$sandbox) {
+function hook_removed_post_updates() {
+ return [
+ 'mymodule_post_update_foo' => '8.x-3.0',
+ 'mymodule_post_update_bar' => '8.x-3.0',
+ 'mymodule_post_update_baz' => '8.x-3.0',
+ ];
+}
+
The method (and the rest of core) also works with semantically versioned, un-prefixed contrib module numbers like 2.0.0 or 3.5.0.
Proposed resolution
Include examples of semantic module versions as well.
Remaining tasks
Blocked on #3066801: Add hook_removed_post_updates() and possibly #3010334: Document how contrib hook_update_N() should be numbered now that modules can be compatible with multiple major branches and versioned semantically.
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|
Issue fork drupal-3118569
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 #2
xjmComment #3
xjmComment #11
quietone commentedComment #12
dwwGood idea. Thanks. I dare say this is “novice” material at this point.
Comment #13
nexusnovaz commentedComment #15
nexusnovaz commentedHoping i've understood this correctly. Please can you review MR !13557. I don't know any other placeholder variable names other than foo, bar, baz, so hopefully what i've done is okay!
Thanks.
Comment #16
dcam commentedI left some feedback and a change suggestion.
Comment #17
nexusnovaz commentedI used your suggestion and pulled 11.x in to fix the pipeline. Ready for review. Also, thank you so much for that google suggestion. I did not know that is what they were called.
Comment #18
dcam commentedFeedback was addressed. This looks good to me.
Comment #19
dwwLooks great. Agreed it was important to use a valid semver version to continue the example. But that’s now fixed. There’s no code or tests here, this is only docs. The pipeline is green, so there’s no code style, cspell, or other weirdness to worry about. I see nothing else to improve. Ship it!
Thanks again,
-Derek
Comment #20
dwwHah, X-post. But yeah, we both agree this is RTBC. Yay
Comment #21
xjmPosted some thoughts.
Comment #22
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 #23
dcam commentedI don't know why it thinks that PHPStan wasn't passing. I rebased the MR and everything is fine.
Comment #24
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 #25
dcam commentedFeedback was addressed.
I'm not sure why the bot keeps thinking that the PHPStan job fails. There's nothing wrong with it.
Comment #26
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 #27
dcam commentedGetting real tired of that.
Comment #28
dwwCool, thanks. Changes look good again. Valid examples with more semver than bespoke-ver.
Comment #30
alexpottBackported to 11.3.x as a docs improvement.