- Issue created by @quietone
- π³πΏNew Zealand quietone
After the change the code block is
At the moment we need to add defensive coding in the future update to ensure it is skipped. function my_module_update_11101() { $equivalent_update = \Drupal::service('update.update_hook_registry')->getEquivalentUpdate(); if ($equivalent_update instanceof \Drupal\Core\Update\EquivalentUpdate) { return $equivalent_update->toSkipMessage(); } // The rest of the update function. } Parameters
And the See also section is
See also batch schemaapi hook_update_last_removed() update_get_update_list() \Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface https://www.drupal.org/node/2535316
The paragraph starting 'The numbers' is now correctly in the flow as follows. The function
hook_update_last_removed()
does display as a link.Naming and documenting your function For each change in a module that requires one or more actions to be performed when updating a site, add a new implementation of hook_update_N() to your my_module.install file (assuming my_module is the machine name of your module). Implementations of hook_update_N() are named (module name)_update_(number). The number (N) must be higher than hook_update_last_removed(). The numbers are normally composed of three parts: 1 or 2 digits for Drupal core compatibility (Drupal 8, 9, 10, etc.). This convention must be followed. If your module is compatible with multiple major versions (e.g., it has a core_version_requirement of '^8.8 || ^9'), use the lowest major core branch it is compatible with (8 in this example). 1 or 2 digits for your module's major release version. Examples: For 8.x-1.* or 1.y.x (semantic versioning), use 1 or 01. For 8.x-2.* or 2.y.x, use 2 or 02. For 8.x-10.* or 10.y.x, use 10. For core 8.0.x, use 0 or 00. For core 8.1.x, use 1 or 01. For core 8.10.x, use 10. This convention is optional but suggested for clarity. Note: While four- digit update hooks are standard, if you follow the above convention, you may run into the need to start using five digits if you get to a major (or, for core, a minor) version 10. This will work fine; what matters is that you must ALWAYS increase the number when a new update hook is added. For example, if you add hook_update_81001(), you cannot later add hook_update_9101(). Instead, you would need to use hook_update_90101(). 2 digits for sequential counting, starting with 01. Note that the x000 number can never be used: the lowest update number that will be recognized and run is 8001. @todo Remove reference to CORE_MINIMUM_SCHEMA_VERSION (e.g., x001) once https://www.drupal.org/project/drupal/issues/3106712 is resolved. Examples:
- Status changed to Needs review
7 months ago 3:44am 12 July 2024 - π³πΏNew Zealand quietone
Adding parent. Not strictly a requirement but one fix is for a typo in π Handling update path divergence between 11.x and 10.x Fixed which was a requirement.
- Status changed to Needs work
7 months ago 4:48am 12 July 2024 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.
- Status changed to Needs review
7 months ago 5:32am 12 July 2024 - π³πΏNew Zealand quietone
To detect
@encode
in the future I tried adding@encode
to the flagWords list and adding@encode
to the file Drupal.php. Unfortunately, the error is not detected. And using\@encode
results inConfiguration Error: Failed to read config file: "/var/www/html/core/.cspell.json"
.I didn't find anything in the cspell docs for this situation.
- Status changed to RTBC
6 months ago 1:15pm 17 July 2024 - Status changed to Fixed
6 months ago 2:12pm 19 July 2024 - π¬π§United Kingdom catch
Committed/pushed to 11.x and cherry-picked back through to 10.3.x, thanks!
Automatically closed - issue fixed for 2 weeks with no activity.