Documentation suggestion - hook_post_update_NAME

Created on 16 June 2025, 18 days ago

API page: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Extension...

Problem: The API page above doesn't say anything about hook_post_update_NAME() hooks not running at installation time. Can someone please add that very important fact to the API?

Maybe something like this?

"⚠️ πŸ’€ Unlike hook_install() or hook_update_N(), post update hooks are not executed at module install.

"Also, any post_update hooks that exist in a module's *.post_update.php file at the time of installation will be added to an internal "already executed" list (in configuration) - making them look like they've been executed properly but were instead skipped outright.

"For 'do-these-tasks-at-time-of-install' tasks, use hook_install() instead."

(Sidenote: An older version of the page at https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Extension... had at least some information on it, but this 11.x page is oddly devoid of any notes.)

πŸ’¬ Support request
Status

Active

Version

11.0 πŸ”₯

Component

documentation

Created by

πŸ‡ΊπŸ‡ΈUnited States aubjr_drupal

Live updates comments and jobs are added and updated live.
  • Needs documentation

    A documentation change is requested elsewhere. For Drupal core (and possibly other projects), once the change has been committed, this status should be recorded in a change record node.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024