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

Issue fork drupal-3118569

Command icon 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

xjm created an issue. See original summary.

xjm’s picture

Title: Add an example of a semver contrib module number to the update hook example for hook_removed_post_upadtes() » Add an example of a semver contrib module number to the update hook example for hook_removed_post_updates()
xjm’s picture

Issue summary: View changes

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Status: Postponed » Active
dww’s picture

Issue tags: +Novice

Good idea. Thanks. I dare say this is “novice” material at this point.

nexusnovaz’s picture

Assigned: Unassigned » nexusnovaz

nexusnovaz’s picture

Assigned: nexusnovaz » Unassigned
Status: Active » Needs review

Hoping 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.

dcam’s picture

Status: Needs review » Needs work

I left some feedback and a change suggestion.

nexusnovaz’s picture

Status: Needs work » Needs review

I 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.

dcam’s picture

Status: Needs review » Reviewed & tested by the community

Feedback was addressed. This looks good to me.

dww’s picture

Looks 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

dww’s picture

Hah, X-post. But yeah, we both agree this is RTBC. Yay

xjm’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: -Novice

Posted some thoughts.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new703 bytes

The 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.

dcam’s picture

Status: Needs work » Needs review

I don't know why it thinks that PHPStan wasn't passing. I rebased the MR and everything is fine.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new703 bytes

The 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.

dcam’s picture

Status: Needs work » Needs review

Feedback was addressed.

I'm not sure why the bot keeps thinking that the PHPStan job fails. There's nothing wrong with it.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new703 bytes

The 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.

dcam’s picture

Status: Needs work » Needs review
Issue tags: +no-needs-review-bot

Getting real tired of that.

dww’s picture

Status: Needs review » Reviewed & tested by the community

Cool, thanks. Changes look good again. Valid examples with more semver than bespoke-ver.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

alexpott’s picture

Version: main » 11.3.x-dev
Status: Reviewed & tested by the community » Fixed

Backported to 11.3.x as a docs improvement.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • alexpott committed 6f4f16ae on 11.3.x
    docs: #3118569 Add an example of a semver contrib module number to the...

  • alexpott committed 20597952 on 11.x
    docs: #3118569 Add an example of a semver contrib module number to the...

  • alexpott committed 6a0b6613 on main
    docs: #3118569 Add an example of a semver contrib module number to the...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.