When navigating my site which I just upgraded from 5.2 I get the following message :

Fatal error: [] operator not supported for strings in c:\documents and settings\tgu\my documents\mes sites\restosh60\modules\locale\locale.module on line 511

Comments

thierry_gd’s picture

I also get at a few places the following one :
warning: in_array(): Wrong datatype for second argument in c:\documents and settings\tgu\my documents\mes sites\restosh60\modules\locale\locale.module on line 506.

gpk’s picture

So it looks like $parsed is a string not an array.

What is the exact content of the variable 'parsed' in the {variables} table in the database? (It should look like a strange (serialized) string.)

gábor hojtsy’s picture

Hm, I was looking for where this might end up as a string, but did not find anything useful.

$ grep -r "javascript_parsed" *
includes/common.inc:  variable_set('javascript_parsed', array());
includes/locale.inc: *   New content of the 'javascript_parsed' variable.
includes/locale.inc:  $parsed = variable_get('javascript_parsed', array());
includes/locale.inc:  variable_set('javascript_parsed', $parsed);
modules/locale/locale.module:  $parsed = variable_get('javascript_parsed', array());
modules/locale/locale.module:    variable_set('javascript_parsed', $parsed);
modules/locale/locale.module:    variable_set('javascript_parsed', $parsed);

In common.inc drupal_clear_js_cache() clears the JS locale file cache to an array.
In locale.inc _locale_invalidate_js() starts from an array by default and then saves an array, and that's all where this is accessed.
In locale.module, again all usage seems to be array only with the += adding up elements as needed.

So all-in-all, I don't see a place in our code, when it goes wrong in itself.

What's your PHP version? Are you sure all your Drupal updates went fine? And also, as gpk asked (although he had the variable name wrong): What is the exact content of the variable 'javascript_parsed' in the {variables} table in the database?

gpk’s picture

>although he had the variable name wrong
Ooops! thanks for the correction.

thierry_gd’s picture

I don't understand what has happened but the problem is not happening anymore.

The issue can be closed

PhalanX’s picture

Status: Active » Closed (won't fix)