summaryrefslogtreecommitdiff
path: root/modules/system/system.api.php
diff options
context:
space:
mode:
authorJennifer Hodgdon <yahgrp@poplarware.com>2012-06-18 14:18:18 -0700
committerJennifer Hodgdon <yahgrp@poplarware.com>2012-06-18 14:18:18 -0700
commit07e5e3e2331c08ca126835218bd7a47613cabb2c (patch)
treece1f3a6ea99476fbe43d370746d460b5523ec035 /modules/system/system.api.php
parentd5ed9164cca8fca4a6168ee39c2941fc1e2a1331 (diff)
downloadbrdo-07e5e3e2331c08ca126835218bd7a47613cabb2c.tar.gz
brdo-07e5e3e2331c08ca126835218bd7a47613cabb2c.tar.bz2
Issue #1619482 by mr.baileys: Fix up documentation for hook_update_N
Diffstat (limited to 'modules/system/system.api.php')
-rw-r--r--modules/system/system.api.php62
1 files changed, 32 insertions, 30 deletions
diff --git a/modules/system/system.api.php b/modules/system/system.api.php
index 57eb6c726..4ff2b4c0e 100644
--- a/modules/system/system.api.php
+++ b/modules/system/system.api.php
@@ -3248,33 +3248,30 @@ function hook_install() {
/**
* Perform a single update.
*
- * For each patch which requires a database change add a new hook_update_N()
- * which will be called by update.php. The database updates are numbered
- * sequentially according to the version of Drupal you are compatible with.
- *
- * Schema updates should adhere to the Schema API:
- * @link http://drupal.org/node/150215 http://drupal.org/node/150215 @endlink
- *
- * Database updates consist of 3 parts:
- * - 1 digit for Drupal core compatibility
- * - 1 digit for your module's major release version (e.g. is this the 5.x-1.* (1) or 5.x-2.* (2) series of your module?)
- * - 2 digits for sequential counting starting with 00
- *
- * The 2nd digit should be 0 for initial porting of your module to a new Drupal
- * core API.
+ * For each change that requires one or more actions to be performed when
+ * updating a site, add a new hook_update_N(), which will be called by
+ * update.php. The documentation block preceding this function is stripped of
+ * newlines and used as the description for the update on the pending updates
+ * task list. Schema updates should adhere to the
+ * @link http://drupal.org/node/150215 Schema API. @endlink
+ *
+ * Implementations of hook_update_N() are named (module name)_update_(number).
+ * The numbers are composed of three parts:
+ * - 1 digit for Drupal core compatibility.
+ * - 1 digit for your module's major release version (e.g., is this the 7.x-1.*
+ * (1) or 7.x-2.* (2) series of your module?). This digit should be 0 for
+ * initial porting of your module to a new Drupal core API.
+ * - 2 digits for sequential counting, starting with 00.
*
* Examples:
- * - mymodule_update_5200()
- * - This is the first update to get the database ready to run mymodule 5.x-2.*.
- * - mymodule_update_6000()
- * - This is the required update for mymodule to run with Drupal core API 6.x.
- * - mymodule_update_6100()
- * - This is the first update to get the database ready to run mymodule 6.x-1.*.
- * - mymodule_update_6200()
- * - This is the first update to get the database ready to run mymodule 6.x-2.*.
- * Users can directly update from 5.x-2.* to 6.x-2.* and they get all 60XX
- * and 62XX updates, but not 61XX updates, because those reside in the
- * 6.x-1.x branch only.
+ * - mymodule_update_7000(): This is the required update for mymodule to run
+ * with Drupal core API 7.x when upgrading from Drupal core API 6.x.
+ * - mymodule_update_7100(): This is the first update to get the database ready
+ * to run mymodule 7.x-1.*.
+ * - mymodule_update_7200(): This is the first update to get the database ready
+ * to run mymodule 7.x-2.*. Users can directly update from 6.x-2.* to 7.x-2.*
+ * and they get all 70xx and 72xx updates, but not 71xx updates, because
+ * those reside in the 7.x-1.x branch only.
*
* A good rule of thumb is to remove updates older than two major releases of
* Drupal. See hook_update_last_removed() to notify Drupal about the removals.
@@ -3293,8 +3290,8 @@ function hook_install() {
* information between successive calls, and the $sandbox['#finished'] value
* to provide feedback regarding completion level.
*
- * See the batch operations page for more information on how to use the batch API:
- * @link http://drupal.org/node/180528 http://drupal.org/node/180528 @endlink
+ * See the batch operations page for more information on how to use the
+ * @link http://drupal.org/node/180528 Batch API. @endlink
*
* @param $sandbox
* Stores information for multipass updates. See above for more information.
@@ -3305,9 +3302,14 @@ function hook_install() {
* reason, it will throw a PDOException.
*
* @return
- * Optionally update hooks may return a translated string that will be displayed
- * to the user. If no message is returned, no message will be presented to the
- * user.
+ * Optionally, update hooks may return a translated string that will be
+ * displayed to the user after the update has completed. If no message is
+ * returned, no message will be presented to the user.
+ *
+ * @see batch
+ * @see schemaapi
+ * @see hook_update_last_removed()
+ * @see update_get_update_list()
*/
function hook_update_N(&$sandbox) {
// For non-multipass updates, the signature can simply be;