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.)

Files: 
CommentFileSizeAuthor
#12 adding-locale-1425260-12.patch405 bytesmgifford
PASSED: [[SimpleTest]]: [MySQL] 190 pass(es).
[ View ]
#6 log upgrade script from 6.24 (upgrading from 6.22)54.17 KBboshard
#6 locale module enabled earlier 27.71 KBboshard

Comments

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

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

Well, Drupal runs updates for disabled modules.

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.

I too have this problem

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

@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.

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

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

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

@andypost: Yes, that looks like it.

StatusFileSize
new405 bytes
PASSED: [[SimpleTest]]: [MySQL] 190 pass(es).
[ View ]

This worked for me.

Status:Active» Needs review

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

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

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.

Same issue same solution.

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.

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.

Status:Fixed» Reviewed & tested by the community

Fixed means commited

Yes, #12 allows update.php to proceed.

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

Confirm #17
Many thanks.

no errors on update with patch in #12 applied

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

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?

EDIT: Thanks for fixing it :)

@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.

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

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

@ Gábor Many thanks for your great work!

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

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

b

@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.

@Gábor Many thanks for your great work!

My variation?

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

#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

#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!

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

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.

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.

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

Many thanks for your continued work!

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.

Yes, it should.

Thanks for clarification.

Status:Fixed» Closed (fixed)

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