Climateimc.org and http://columbus.indymedia.org/ are both getting these errors.

* warning: Illegal offset type in isset or empty in /var/www/cbusimc.org/includes/path.inc on line 65.
* warning: Illegal offset type in /var/www/cbusimc.org/includes/path.inc on line 70.

With climateimc, the problem is that the IMC cities list is returning a $map[$path_language][$path] that's not a string, it's a SimpleXMLElement::__set_state(array( ))

The array is:
3 => array ( 'file' => '/var/www/climateimc.org/dev/sites/all/modules/indymedia_cities/indymedia_cities.theme.inc', 'line' => 112, 'function' => 'l', 'args' => array ( 0 => SimpleXMLElement::__set_state(array( )), 1 => SimpleXMLElement::__set_state(array( )), ), )

ekes thinks perhaps the XML isn't parsing properly?

I'm on IndymediaIRC pretty regularly (australian time).

Comments

mfb’s picture

I cannot reproduce this warning message so I'm not sure what would be causing it.

I don't think this module should even be calling drupal_lookup_path(). Could you generate a stack trace to see how it got there?

The expected behavior is that the arguments for l() at line 112 are SimpleXMLElement objects. PHP should automatically convert the objects to strings, although there might be cases where this doesn't work and we need to explicitly cast using (string).

naught101’s picture

Kam from Sydney indy is getting the same problem, confirmed that it's caused by this module. ClimateIMC and sydney IMC are one the same server.

How would you like me to run a backtrace? Ekes had me add this to includes/path.inc after line 65:

if (!is_string($path)) {
drupal_set_message('path is '. var_export($path, true) .' and path_language is '. var_export($path_language, true));
drupal_set_message(var_export(debug_backtrace(), true)); };

The array in the first post is from that. I can post the whole thing, but it's really long. You can view it at
66.135.32.15 dev.climateimc.org (no dns, you'll have to add it to your hosts file)

mfb’s picture

Thanks. Btw you can also install xdebug to get pretty backtraces. Now... why am I not seeing this on my install?! Since I can't reproduce it's rather difficult to fix.

szczym’s picture

Helo, im in the process of building new imc-pl site. Im also having path issue (currently its on common shared hosting server).

* warning: Illegal offset type in isset or empty in /home/indykant/public_html/includes/path.inc on line 65.
* warning: Illegal offset type in /home/indykant/public_html/includes/path.inc on line 70.

My site is almost vanilla based on http://drupal.org/project/indymedia_alba, have clean urls turn on and 2 languages (based on path).

mfb’s picture

I still cannot reproduce this so not sure how to fix. I just changed london.indymedia.org to http://london.indymedia.org in the database just in case the lack of leading http:// was the issue.

szczym’s picture

so its a server issue ? maybe me and naught101 compare our phpinfos with the working one? if any of you is around, catch me on irc.indymedia.org#drupal-dev

naught101’s picture

StatusFileSize
new8.51 KB

Workaround: copy html from block into custom block.

Attached: http://www.climateimc.org/en/admin/reports/status/php

szczym’s picture

StatusFileSize
new9.21 KB

here is my phpinfo too

naught101’s picture

StatusFileSize
new1.71 KB

Enabled modules:

mfb’s picture

It's working for me with PHP 5.2.6-3ubuntu4.1 on Ubuntu 9.04 and PHP 5.2.9 on FreeBSD 7.2

Can you try adding (string) in indymedia_cities.theme.inc where it's hitting the bug, to see if forcibly casting to string helps at all?

szczym’s picture

Status: Active » Patch (to be ported)
StatusFileSize
new1.22 KB

Ekes fixed the problem on our website, it works, no errors. im attaching the patch.

thanx ekes !

naught101’s picture

Status: Patch (to be ported) » Reviewed & tested by the community

Works for me. Thanks.

mfb’s picture

Status: Reviewed & tested by the community » Fixed

Fixed in CVS. I used strval() rather than (string) but these should be functionally equivalent. Thanks for the patch.

Status: Fixed » Closed (fixed)

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