Heine

  • Home
  • Drupal
  • About
Home » Guides » Drupal Developer FAQ

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.

‹ Why is a menu item from hook_menu not accessible? up Drupal Forms API ›
  • Printer-friendly version

Recent posts

  • Teampassword manager's password generator is biased
  • Other vectors for SA-CORE-2014-005?
  • Lazy loading: hook_hook_info is for hook owners only.
  • "Always offline" problem in EA's Origin due to antivirus
  • From bug to exploit - Bakery SSO
more

Security reviews

I provide security reviews of custom code, contributed modules, themes and entire sites via LimoenGroen.

Contact us for a quote.

Follow @ustima

Copyright © 2021 by Heine Deelstra. All rights reserved.

  • Home
  • Drupal
  • About