Skip to content

Commit bd23517

Browse files
authored
Clarify that the Drupal API isn't completely unavailable (#6151)
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.
1 parent 65d6b7c commit bd23517

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

docs/deploycommand.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,20 @@ drush deploy:hook
1313
```
1414

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

18-
| Function | Drupal API | Purpose |
20+
21+
| Function | Provided by | Purpose |
1922
| --- | --- | --- |
20-
| [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. |
21-
| [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. |
22-
| [HOOK_deploy_NAME()](https://github.com/drush-ops/drush/tree/HEAD/drush.api.php) | Allowed | Runs *after* config is imported. |
23+
| [HOOK_update_N()] | Drupal | Low level changes. |
24+
| [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. |
25+
| [HOOK_deploy_NAME()](https://github.com/drush-ops/drush/tree/HEAD/drush.api.php) | Drush | Runs *after* config is imported. |
2326

2427
## Configuration
2528

2629
If you need to customize this command, you should use Drush configuration for the
2730
subcommands listed above (e.g. [updatedb](commands/updatedb.md), [config:import](commands/config_import.md), etc.).
31+
32+
[HOOK_update_N()]: https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Extension!module.api.php/function/hook_update_N

0 commit comments

Comments
 (0)