Project:Indymedia cities list
Version:6.x-1.2
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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

#1

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

#2

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)

#3

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.

#4

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

#5

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.

#6

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

#7

Workaround: copy html from block into custom block.

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

AttachmentSize
climateimc_phpinfo.html_.gz 8.51 KB

#8

here is my phpinfo too

AttachmentSize
php-menchester.html_.gz 9.21 KB

#9

Enabled modules:

AttachmentSize
cimc_modules.txt 1.71 KB

#10

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?

#11

Status:active» patch (to be ported)

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

thanx ekes !

AttachmentSize
ekes-path-fix.patch 1.22 KB

#12

Status:patch (to be ported)» reviewed & tested by the community

Works for me. Thanks.

#13

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.

#14

Status:fixed» closed (fixed)

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

nobody click here