Fatal error: Cannot use string offset as an array in C:\apachefriends\xampp\htdocs\searcy\includes\theme.inc on line 505

Not sure where this error is coming from. I've seen it a few times, most recently in the admin/views page for the views module. It's a difficult error to troubleshoot bc I'm not positive it's a views problem. I tried removing all of the other modules and it still gave me the error.

Help?

Jay

Comments

iwankgb’s picture

i can see nothing but comments on line 505 both in 4.7.2 and 4.6.6. what is your version of drupal?

sangamreddi’s picture

Please provide more details about verion of drupal, php etc and theme as well..

Sunny                      
www.gleez.com | www.sandeepone.com

drupalninja99’s picture

hope that helps

Jay

bejam’s picture

I am getting this too. I thought it might be an interaction with a buggy module but stripped my version right down and it occurs with several modules that provide links, including category print and emailpage. It only happens with cvs HEAD (version 1.297).
Line 505 is: $link['#attributes']['class'] = str_replace('_', '-', $key);

If i role back to version 1,.295 then all is well.

I have also noticed that some of my links (e.g. readmore) are appearing in the $vars[node]->links array as an array in their own right (with keys '#href' and '#title' whilst others are a string with and tag. Not sure if this is related, but my 'print $links' in comment.tpl.php gives some of the links as the text 'Array'.

gerd riesselmann’s picture

Had the same problem and traced it down to the category modukle.

Goto to line 270 in category.module. Comment out line

$links[] = l($category->title, category_category_path($category), array('rel' => 'tag', 'title' => $category->description));

and insert this line:

$links[] = array(
  '#title' => $category->title, 
  '#href' => category_category_path($category), 
  '#attributes' => array('rel' => 'tag', 'title' => $category->description)
);

This works for me.

------------------
Gerd Riesselmann
www.gerd-riesselmann.net

mgifford’s picture