Closed (cannot reproduce)
Project:
Memcache API and Integration
Version:
5.x-1.8
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
9 Apr 2008 at 19:08 UTC
Updated:
4 Feb 2011 at 07:39 UTC
If using memcache + "i18n - menu" script dies with:
[09-Apr-2008 21:53:16] PHP Fatal error: Cannot use string offset as an array in /var/www/vhosts/www.destiny.lv/www/includes/menu.inc on line 1229
which corresponds to
// Menu items not in the DB get temporary negative IDs.
$temp_mid = min(array_keys($_menu['items'])) - 1;
$new_items = array();
foreach ($menu_item_list as $item) {
if (isset($item['callback'])) {
>>> $_menu['callbacks'][$item['path']] = array('callback' => $item['callback']);
if (isset($item['callback arguments'])) {
Comments
Comment #1
firebus commentedis it that case that i18n menu does it's own caching?
if so, have you removed calls to serialize and unserialize
memcache handles serialization internally - if you look at the memcache patches, you'll see that the bulk of what they do is to remove calls to serialize and unserialize from core caching code. you'll need to do the same with any contrib module you use that caches
Comment #2
ghostks commentedI've searched for the serialize/unserialize code in i18n, menu.inc and removed all instances but anyway the problem exists. I will try to investigate more and will notify if I'll find anything. The most interesting thing only i18n.menu sub module is broken, all others i18n.* are working perfectly.
Comment #3
snufkin commentedsame problem, with i18n here too.
Comment #4
robertdouglass commentedDoes the problem exist after removing serialize/unserialize AND clearing the caches (memcache and db)?
Comment #5
robertdouglass commentedAlso try with a memcache version greater than 1.7 (ie DRUPAL-5) because I think a patch that went in might solve this but need confirmation.
Comment #6
robertdouglass commentedComment #7
pcambraI am getting this error too in a multisite installation.
One of the sites, which has not i18n module installed, got the error, but it went away after running update.php.
The other site gets the error even after the update.php, if i clear the cache tables, the site runs good once, but the next time i get the error:
Fatal error: Cannot use string offset as an array in menu.inc on line 1229Anyone can help me? (using drupal 5.10)
Thanks
Comment #8
mikhailian commentedGot exactly the same problem, i18n-menu, 5.10,
Fatal error: Cannot use string offset as an array in menu.inc on line 1229This configuration seems to be very popular ;-)
And it does not help changing in i18nmenu.module
cache_set($cid, 'cache_menu', serialize($_menu), time() + (60 * 60 * 24));into
cache_set($cid, 'cache_menu', $_menu, time() + (60 * 60 * 24));I still get the same error on line 1229
Comment #9
mikhailian commentedGosh! Forgot to restart memcached!!!
The problem is solved with this simple patch to i18nmenu.module:
Comment #10
snufkin commentedI haven't been able to reproduce the error with 5.x-1.8 so far.
Comment #11
catchThat's a bug with i18n_menu.