Here are some fun facts:
1. Drupal runs updates for modules that are disabled.
2. Many modules use their own API functions in their update functions.
3. Many API functions such as mymodule_save() do something like
module_invoke_all('mymodule_save') inside of them.
4. For reasons of code organization, many modules like to implement their own hooks in cases like the above, rather than sticking extra hardcoded logic into the API function directly.
5. module_invoke_all() does not invoke hooks for disabled modules.
Putting it all together, that means that when you invoke your own module's API function from inside an update function, it might work very differently depending on whether your module is disabled at the time the update is being run - and that can break things nicely.
1. Tell people that they should generally not be using API functions inside update hooks (unless they really know what they're doing), but rather do direct database queries instead. See also: . In general this doesn't seem desirable though.
2. When MAINTENANCE_MODE is 'update', sometimes module_invoke_all() and friends could invoke the hook on disabled modules as well? - needs a lot more thought though.
PASSED: [[SimpleTest]]: [MySQL] 58,583 pass(es). View
PASSED: [[SimpleTest]]: [MySQL] 58,896 pass(es). View
FAILED: [[SimpleTest]]: [MySQL] 58,762 pass(es), 3 fail(s), and 2 exception(s). View
FAILED: [[SimpleTest]]: [MySQL] 58,685 pass(es), 3 fail(s), and 4 exception(s). View