While running the upgrade script in Drupal 6.24 (upgrading from 6.22), I got the following error:

An error occurred. http://example.com/update.php?id=1&op=do
Fatal error: Call to undefined function locale_inc_callback() in /home/www-data/example.com/www/modules/locale/locale.install on line 236

OS: Debian 5.0.9
Web server: Apache 2.2.9 (aka. 2.2.9-10+lenny11)
PHP: 5.2.6 (5.2.6.dfsg.1-1+lenny13)

(However I guess this bug is not related to the environment I'm running Drupal in.)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

müzso’s picture

The problem is most probably related to this patch:
http://drupal.org/node/504506
"Drupal.formatPlural incorrectly handle complex plural rules"

andypost’s picture

Are you running update with drush or site/update.php ?

I see actual reason for D6 to run {some-module}.install without loading {some-module}.module
But it looks like it is because called function locale_inc_callback() lives inside locale.module

Gábor Hojtsy’s picture

Well, Drupal runs updates for disabled modules.

Gábor Hojtsy’s picture

Added this to the known issues on http://drupal.org/drupal-7.12

In Drupal 6.24 if you had locale module enabled earlier, but it is not currently turned on, the update will fail with Call to undefined function locale_inc_callback(). A fix is being worked on for Drupal core.

My understanding is that is the underlying problem.

HTF’s picture

I too have this problem

bardill’s picture

Sorry I don't understand the problem. Running the upgrade script from 6.24 (upgrading from 6.22), I got no error.
Locale module was enabled earlier and during the update (yes, I update drupal core without disabling the modules - see: http://drupal.org/node/1173012#comment-5252892)

Anyway it's a multi-language site and seems to work fine.
See the attachment. many thanks.

b

Gábor Hojtsy’s picture

@boshadr: yes, the problem appears if you don't currently have the local module enabled (see the text in the note again), BUT you had it enabled before. Judging by your explanation (you have it enabled before and still have it enabled), you should not be affected.

HTF’s picture

I can confirm this is true, I have just re-enabled the local module and the update script ran fine.

bardill’s picture

@Gábor Thanks. I confirm!
Update Drupal core without disabling the modules is a good way :) Thanks Carlos8f

andypost’s picture

probably we need drupal_load('module', 'locale'); or just direct call to _locale_invalidate_js() with locale.inc include

Gábor Hojtsy’s picture

@andypost: Yes, that looks like it.

mgifford’s picture

FileSize
405 bytes

This worked for me.

mgifford’s picture

Status: Active » Needs review

Oops.. changing status to needs review. This would be reason to put out a 6.25 release I assume.

bardill’s picture

@ mgifford yes, 6.25 I think it's the best way!

strawberrybrick’s picture

had same error when upgrading from 6.22 - > 6.24. Turned locale module on, re-ran update.php, no error, then turned locale module off.

motter’s picture

Same issue same solution.

DarrellDuane’s picture

Status: Needs review » Fixed

I applied this patch. I have upgraded two sites from 6.22 to 6.24 that both used to have the locale module enabled, but I disabled this module before running upgrade.php. The database upgrade worked fine in both cases.

Frogtown’s picture

Confirming here on my end. Upgrading from 6.22 to 6.24 this happened, and we have never had the locale module running before. Enabled the module, ran update.php again and it ran fine.

andypost’s picture

Status: Fixed » Reviewed & tested by the community

Fixed means commited

salvis’s picture

Yes, #12 allows update.php to proceed.

venusrising’s picture

Yes to #12. Enabled locale ran update and all went fine.

bardill’s picture

Confirm #17
Many thanks.

izmeez’s picture

no errors on update with patch in #12 applied

bardill’s picture

@ Gábor - 6.25 release is in plan in the next days?

SyRenity’s picture

Hi.

About these who using Drush, what would be the best course of action?

Drush now reports to me every time there is nothing to update.
Is there a way to apply the fix manually?

pingers’s picture

EDIT: Thanks for fixing it :)

Gábor Hojtsy’s picture

@boshard: I'm tracking this one and #1425868: Duplicate entry of themes primary key in systems table of Drupal 6.24 (using Drush or Ægir), both would need to be fixed for a Drupal 6.25 to be out.

rockland’s picture

Same problem, same solution as #7. Thank you!

bardill’s picture

Also here: same problem, same solution as #7!
Many thanks.

bardill’s picture

@ Gábor Many thanks for your great work!

aubjr_drupal’s picture

Same problem as #7, same solution as others (re-enable, run update, disable). Hope this is fixed in 6.25.

bardill’s picture

@Gábor 6.25 will be released with the usual time interval? 3/4 months?
Many thanks for your continued work.

b

Gábor Hojtsy’s picture

@boshard: I think if we can be absolutely sure in this one and #1425868: Duplicate entry of themes primary key in systems table of Drupal 6.24 (using Drush or Ægir) is fixed too, then we can release on Feb 29th in the usual Drupal core release window (last Wed of month). I don't think we'd want to include any other fixes in 6.25, its best to not give any chance to mistakes.

bardill’s picture

@Gábor Many thanks for your great work!

ElegantSolutions’s picture

My variation?

I have never used the locale, but just activating it was enough to get update to work.

coolhandlukek2’s picture

#7 worked for me

Was running update.php and getting Fatal error: Call to undefined function locale_inc_callback() in /modules/locale/locale.install

Thanks @Gábor

weavie’s picture

#7 worked - I had locale enabled, disabled it some time ago, updated failed with error "Call to undefined function locale_inc_callback()".
Renabled locale, ran update, disabled locale.

thanks!

lgb’s picture

#7 is confirmed fix for me. Thank you!!

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed, pushed. The current plan is that Drupal 6.25 will be released with this fix on Feb 29th.

weavie’s picture

I'm seeing a recurring error now that might be related, but I'm not sure.
I had the above issue (#37) and thought it was resolved.
Now on each page load I am getting the following pairs of errors, one entry for each block on content or something, so multiple pairs of log entries on page load:

Invalid argument supplied for foreach() in /var/www/html/site/includes/common.inc on line 959.
strtr() [function.strtr]: The second argument is not an array in /var/www/html/site/includes/common.inc on line 976.

The reason why I think it could be related is because that section of common.inc deals with locale.

Any ideas or suggestions?
I've tried de-activating and uninstalling locale and content translation and then re-activating them but it's had no effect.

Thanks.

Gábor Hojtsy’s picture

Drupal 6.25 with this fix should be available in a matter of minutes at http://drupal.org/node/1461656 and at http://drupal.org/drupal-6.25

bardill’s picture

Many thanks for your continued work!

SyRenity’s picture

Hi.

For drush users, will updating to 6.25 solve this issue even if previous update to 6.24 triggered this error (but still completed)?

Thanks.

Gábor Hojtsy’s picture

Yes, it should.

SyRenity’s picture

Thanks for clarification.

Status: Fixed » Closed (fixed)

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