Heine

  • home
  • drupal
  • drupal core commits
  • about
Home

Why is my module's update hook not listed on update.php's selection form?

Apart from obvious causes (module not enabled, update hook misnamed), there's a actual pitfall here; You cannot use mixed case filenames for modules.

Background

Suppose you have a module Example with Example.module and Example.install as files. Example.install contains your Example_update_6001() function.

Update.php uses the PHP function get_defined_functions to enumerate update hooks. The function returns lowercase functionnames (PHP function names are case insensitive). Drupal, however, does a case-sensitive string compare (strpos) with the module name. These will never match.

Solution

Use all lowercase module names (example.module vs. Example.module, mymodule.module vs. MyModule.module). Alternatively, wait for a bugfix via Issue #200628.

No votes yet
‹ Why is a menu item from hook_menu not accessible? up Drupal Forms API ›
  • Printer-friendly version
  • Login or register to post comments

Recent posts

  • Unserializing user-supplied data, a bad idea
  • Planet Drupal past and current
  • Help! - Cannot access a global variable.
  • Why is my module's update hook not listed on update.php's selection form?
  • How do I add a class to a link generated with l()
more

Security reviews

  • Afraid custom code makes your site vulnerable?
  • You don't really trust that module you just downloaded from Drupal.org?

Sleep better after a security review.

Tags

Captcha CSRF Drupal embed Input Format modx OpenID Performance Planet Drupal rants Security Varnish
more tags
  • home
  • drupal
  • drupal core commits
  • about

Copyright © 2010 by Heine Deelstra. All rights reserved.