Hi
Our hosting provider upgraded PHP4 to PHP5, and now some parts of our Drupal 5.x site have stopped working.
This is what we are getting when trying to access many pages:
Fatal error: Cannot use string offset as an array in /home/MYSITE/public_html/sites/all/themes/MYSITE/template.php on line 51
Any suggestions for fixing this?
Thank you!
-------------------------------------------------------------------- Albert
On Tuesday 25 March 2008 10:50:47 am Albert Cuesta wrote:
Hi
Our hosting provider upgraded PHP4 to PHP5, and now some parts of our Drupal 5.x site have stopped working.
This is what we are getting when trying to access many pages:
Fatal error: Cannot use string offset as an array in /home/MYSITE/public_html/sites/all/themes/MYSITE/template.php on line 51
Any suggestions for fixing this?
Try posting the function that wraps around line 51.
Quoting Albert Cuesta acuesta@gmail.com:
Hi
Our hosting provider upgraded PHP4 to PHP5, and now some parts of our Drupal 5.x site have stopped working.
Which version of PHP5?
This is what we are getting when trying to access many pages:
Fatal error: Cannot use string offset as an array in /home/MYSITE/public_html/sites/all/themes/MYSITE/template.php on line 51
Any suggestions for fixing this?
Try emptying your cache tables. Perhaps you also need to empty the session table. You might even need to empty the cached browser cookies.
If that fails to correct you'll need to tell us what is on line 51 of template.php.
Earnie -- http://for-my-kids.com/ -- http://give-me-an-offer.com/
On Tuesday 25 March 2008, Albert Cuesta wrote:
Hi
Our hosting provider upgraded PHP4 to PHP5, and now some parts of our Drupal 5.x site have stopped working.
This is what we are getting when trying to access many pages:
Fatal error: Cannot use string offset as an array in /home/MYSITE/public_html/sites/all/themes/MYSITE/template.php on line 51
Any suggestions for fixing this?
Thank you!
There are several array handling functions that are supposed to take an array and an array. In PHP 4, you could be lazy and pass a string as the second parameter and PHP would silently convert it to a one-element array for you. PHP 5 requires you to pass a for-reals array as the second parameter. It sounds like that is what you're running into.
Check to see what's on line 51, and see the PHP manual for any functions youre using. If that's not it, then as others have said "show us the code!" :-)
Thanks who everyone who replied. Here's the offending code (line #51 is marked with -->)
// Automatically add a class to each link and also to each LI if (isset($link['attributes']) && isset($link['attributes']['class'])) { $link['attributes']['class'] .= ' ' . $key; $class = $key; } else { --> $link['attributes']['class'] = $key; $class = $key; }
2008/3/26, Larry Garfield larry@garfieldtech.com:
On Tuesday 25 March 2008, Albert Cuesta wrote:
Hi
Our hosting provider upgraded PHP4 to PHP5, and now some parts of our Drupal 5.x site have stopped working.
This is what we are getting when trying to access many pages:
Fatal error: Cannot use string offset as an array in /home/MYSITE/public_html/sites/all/themes/MYSITE/template.php on line 51
Any suggestions for fixing this?
Thank you!
There are several array handling functions that are supposed to take an array and an array. In PHP 4, you could be lazy and pass a string as the second parameter and PHP would silently convert it to a one-element array for you. PHP 5 requires you to pass a for-reals array as the second parameter. It sounds like that is what you're running into.
Check to see what's on line 51, and see the PHP manual for any functions youre using. If that's not it, then as others have said "show us the code!" :-)
-- Larry Garfield AIM: LOLG42 larry@garfieldtech.com ICQ: 6817012
"If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it." -- Thomas Jefferson
-- [ Drupal support list | http://lists.drupal.org/ ]
Hi - I really am lost here. I've updated to the latest spam module and my users still get the following message when submitting a comment - any ideas on how to fix? I am afraid that I am losing many comments because of this. Any help is very much appreciated.
---------------------------------- Access denied The comment you posted has been flagged as potential spam. It will not be visible until the site administrator has a chance to review it. Your IP address (172.16.10.3) was recently used to post spam to this website. For this reason, you are currently not allowed to post new content. If you believe this is in error, please contact the site administrator. You are not authorized to access this page. ----------------------------------
I can't find this ip address in the spam filters, or in my htaccess. Any ideas where else I could look?
Thanks!