Skip to content

Commit

Permalink
Clarify that the Drupal API isn't completely unavailable (#6151)
Browse files Browse the repository at this point in the history
This was triggered by a Slack conversation where someone was uncertain
exactly what it meant when the page said the Drupal API was not allowed.
I think this could be particularly confusing if you aren't already
primed on writing hook_update_N() implementations.
  • Loading branch information
andriokha authored Oct 31, 2024
1 parent 65d6b7c commit bd23517
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions docs/deploycommand.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,20 @@ drush deploy:hook
```

## Authoring update functions
Below are the 3 types of update functions run by this command, in order. Choose the most appropriate for your need.
Below are the 3 types of update functions run by this command, in order. Choose the most appropriate for your
need. **Exercise caution when implementing `HOOK_update_N()`** — the full API isn't available to you, see [the
documentation][HOOK_update_N()] for more details.

| Function | Drupal API | Purpose |

| Function | Provided by | Purpose |
| --- | --- | --- |
| [HOOK_update_n()](https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Extension!module.api.php/function/hook_update_N) | Not allowed | Low level changes. |
| [HOOK_post_update_NAME()](https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Extension!module.api.php/function/hook_post_update_NAME) | Allowed | Runs *before* config is imported. |
| [HOOK_deploy_NAME()](https://github.com/drush-ops/drush/tree/HEAD/drush.api.php) | Allowed | Runs *after* config is imported. |
| [HOOK_update_N()] | Drupal | Low level changes. |
| [HOOK_post_update_NAME()](https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Extension!module.api.php/function/hook_post_update_NAME) | Drupal | Runs *before* config is imported. |
| [HOOK_deploy_NAME()](https://github.com/drush-ops/drush/tree/HEAD/drush.api.php) | Drush | Runs *after* config is imported. |

## Configuration

If you need to customize this command, you should use Drush configuration for the
subcommands listed above (e.g. [updatedb](commands/updatedb.md), [config:import](commands/config_import.md), etc.).

[HOOK_update_N()]: https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Extension!module.api.php/function/hook_update_N

0 comments on commit bd23517

Please sign in to comment.