On this site:
http://MalinaMusic.ru

I noticed a problem during upgrade of some modules. I do upgrade as instructed by Drupal:

1. Disable module
2. Remove old files
3. Put new files
4. Run update.php
5. Enable module

The problem happens if there are new functions in upgrade script for new version of module. Ufter I run update.php Drupal always reports that it cannot find those new functions.

Something like this:
"An error occured. http://malinamusic.ru/update.php?id=30&op=do Fatal error Call to undefined function osmplayer_clear_css() in D:\xamplite\htdocs\sites\all\modules\mediafront\mediafront.install on line 93
"

In this case function osmplayer_clear_css() was added to upgrade script of new version of mediafront module and drupal never finds it. I had the same situation with one another module.

If there are no new functions update.php runs just fine.

the solution for this problem for me is to enable module before running update.php - basically swapping steps 4 and 5. But this is incorrect and might cause some problems. any ideas what could be wrong with my site and how to fix that?

Comments

yelvington’s picture

Your procedure is wrong. Where, exactly, did you find such instructions?

When upgrading a module (not the core, but a module) you do not disable the module. If the module is disabled when update.php is run, its update code will not be processed.

almalino’s picture

yelvington,

It was discussed here many times. Unfortunatelly, I cannot find official Drupal documentation regarding module upgrade procedure. But what are telling makes sence based on my experience.

So, the right sequence is:

1. Disable module
2. Delete old files
3. Put new files
4. Enable module
5. run update.php

Right?

cog.rusty’s picture

Modules need to be enabled before running update.php. See the UPGRADE.txt file included in Drupal 6, step 12.

For a minor update between 6.x versions, you don't even need to disable the modules, unless a README or UPGRADE file in a module says that it needs that.

For a major update (from Drupal 5) you need to follow all the steps, and possibly additional steps required by some modules (for example see CCK's UPGRADE.txt file -- in this case you enable some modules, run update.php, enable some more modules, run update.php again).

almalino’s picture

cog.rusty, thank you! Yuo are very helpful!