Hi,

this patch adds missing documentation of the hook_update_last_removed() as well as some minor improvements to the description of hook_update_N().

Regards,
Tobias

Comments

dave reid’s picture

Category: bug » task
Priority: Critical » Minor

Seems like this could be a valid hook, although it is only implemented by system.install:

./update.php-223-    if (!update_check_incompatibility($module) && $updates !== FALSE && $schema_version >= 0) {
./update.php-224-      // module_invoke returns NULL for nonexisting hooks, so if no updates
./update.php-225-      // are removed, it will == 0.
./update.php:226:      $last_removed = module_invoke($module, 'update_last_removed');
./update.php-227-      if ($schema_version < $last_removed) {
./update.php-228-        $form['start'][$module] = array(
./update.php-229-          '#title' => $module,
--
./modules/system/system.install-1278-
./modules/system/system.install-1279-// Updates for core.
./modules/system/system.install-1280-
./modules/system/system.install:1281:function system_update_last_removed() {
./modules/system/system.install-1282-  return 1021;
./modules/system/system.install-1283-}
./modules/system/system.install-1284-

I would classify this as minor, since we haven't even noticed that this was possibly a hook.

catch’s picture

Status: Needs review » Reviewed & tested by the community

I vaguely remember the issue this was added, and it is indeed supposed to be a hook, the docs look good, so RTBC.

webchick’s picture

Title: Document missing hook_update_last_removed() » Commit missing hook_update_last_removed() documentation to CVS
Version: 7.x-dev » 6.x-dev
Issue tags: +Quick fix

Awesome! Committed to HEAD!

This also needs to be committed to the 6.x (and possibly 5.x) upgrade documentation at contributions/docs/developer/hooks/core.php.

However, this is something that anyone with a CVS account can do, not just Gábor.

dave reid’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 6.x and 5.x

toddy’s picture

Title: Commit missing hook_update_last_removed() documentation to CVS » Fix @link syntax in documentation
Version: 6.x-dev » 7.x-dev
Status: Fixed » Needs review
StatusFileSize
new2 KB

Unfortunately, the syntax for @link is a bit different from the original Doxygen syntax, so the links do not work as expected. This patch should fix the problem.

Regards,
Tobias

dave reid’s picture

Status: Needs review » Reviewed & tested by the community

You can view what's currently being not linked at http://api.drupal.org/api/function/hook_update_N/7. Looks good.

Status: Reviewed & tested by the community » Needs work

The last submitted patch failed testing.

dave reid’s picture

Ah... make sure to run diff -uRp from the root drupal directory.

toddy’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new2.02 KB

Sorry for this. The patch should now apply.

webchick’s picture

Version: 7.x-dev » 6.x-dev
Status: Reviewed & tested by the community » Needs work

Awesome, thanks! Committed to HEAD.

Could someone commit the same to 5.x/6.x?

webchick’s picture

Status: Needs work » Reviewed & tested by the community

Oops. Leaving at RTBC, just wanted to move version down.

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Needs work

hook_update_last_removed() was not in 5.x, so it was a mistake to add it to the 5.x documentation in #4.

- The 5.x commit of hook_update_last_removed() should be reverted.
- #9 should be applied to the 6.x documentation.

gábor hojtsy’s picture

BTW hook_update_last_removed was introduced here: #194310: Check / run updates of disabled modules

jhodgdon’s picture

Status: Needs work » Fixed

Gracious.
I just took care of #12.

Status: Fixed » Closed (fixed)
Issue tags: -Quick fix

Automatically closed -- issue fixed for 2 weeks with no activity.