Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Warning: Illegal string offset


Kiray

Recommended Posts

Hi everybody, 

 

I updated from 2.3.3.4 to 2.3.4 today and right now I'm trying to fix some issues that came with it. The most prominent one at the moment is that 9 php warning messages are popping up when either 

a ) I want to try and register as a new user 

or 

b ) I am in the checkout process and get to the payment step

 

The warnings I get are these, same for both occurences.

 

Warning: Illegal string offset 'type' in/homepages/46/d349321248/htdocs/catalog/includes/functions/html_output.php on line 346

Warning: Illegal string offset 'type' in/homepages/46/d349321248/htdocs/catalog/includes/functions/html_output.php on line 349

Warning: Illegal string offset 'type' in/homepages/46/d349321248/htdocs/catalog/includes/functions/html_output.php on line 350

Warning: Illegal string offset 'type' in/homepages/46/d349321248/htdocs/catalog/includes/functions/html_output.php on line 353

Warning: Illegal string offset 'type' in/homepages/46/d349321248/htdocs/catalog/includes/functions/html_output.php on line 363

Warning: Illegal string offset 'type' in/homepages/46/d349321248/htdocs/catalog/includes/functions/html_output.php on line 370

Warning: Illegal string offset 'type' in/homepages/46/d349321248/htdocs/catalog/includes/functions/html_output.php on line 379

Warning: Illegal string offset 'iconpos' in/homepages/46/d349321248/htdocs/catalog/includes/functions/html_output.php on line 391

Warning: Illegal string offset 'iconpos' in/homepages/46/d349321248/htdocs/catalog/includes/functions/html_output.php on line 394

 

 
I've already read a bunch of stuff about how illegal string offset usually means that the caller of the function is the "one to blame" but I just don't know where to start fixing this. I have never really interfered with any coding besides the colors etc. in css to change the appearance.
 
    if ( !isset($params['type']) ) {
      $params['type'] = 'submit';
    }

This is one example of where the issue occurs. Those are lines 345 to 347.

 

I should probably highlight that arrays are really not my strong suit in php so if somebody tries to explain this to me rather than just already having a solution, please try the "explanation for dummys" style so I can follow you :)

Thank you in advance!
Link to comment
Share on other sites

The html_output.php file didn't change between the two versions you mention so the problem isn't in that file, assuming you haven't made changes to either with addons.  I don't know what you mean by "register as a new user" but if you are talking about the create_account page then that file wasn't changed either and the payment page only had some minor changes.

 

You can't troubleshoot a problem like this, or at least you shouldn't, by stepping through the code. You need to get the problem down to a file, if possible. If you have a number of addons installed and/or are using a template that will complicate matters. I suggest using a compare program like WinMerge, which is free, so you can compare the file changes. You don't need to compare the admin or images directories so that will help.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

The error message is telling you that the function parameter $params apparently came in as a string rather than an array of strings. That means someone is calling the function tep_draw_button() incorrectly (possibly with an empty string rather than a null). If you upgraded from 2.3.3.4, and you have only minor customization (add-ons, etc.) to the store, you might try doing a fresh install of 2.3.4 and customizing that. It would probably be easier than trying to find the bad tep_draw_button() call. It sounds like something went wrong in the upgrade. I don't know if any calls to tep_draw_button() changed between 2.3.3.4 and 2.3.4, but if you had any custom changes or add-ons affecting a call to that function, that would be a good place to start looking.

 

Did your host just upgrade PHP? I think that in some cases in older PHP levels, some things mixing empty strings and empty arrays were tolerated, that newer PHP levels won't accept any longer. It's possible that the upgrade from 2.3.3.4 didn't completely fix everything, or you have code customizations that are no longer valid PHP. Replacing your store with a fresh copy 2.3.4 might be the easiest fix, if you're not going to lose a lot of customization work in the process.

Link to comment
Share on other sites

First of all: Happy new year to you all! :)

 

About your replies: First and foremost thank you a lot for your help!

I feel like WinMerge sound like a good idea. I've never heard of it before but I'll definitely look into it later, maybe I get lucky. 

 

Yes, my host just upgraded their PHP which is why I felt like it was the right time to update.

 

Just in case I can't find the 'wrong' part rather quickly: Is it possible, after a clean, fresh install, to use the same database I am using right now, since it would obviously be bad to lose my customers & products data. Or should I rather export the one I have right now, set up a new DB and try importing the data again?

 

Thank you again!

Link to comment
Share on other sites

If you successfully migrated your database from 2.3.3.4 to 2.3.4 (offhand, I don't recall whether there's any difference), you should be able to use your existing database. Just be careful not to destroy it in the process of installing a fresh 2.3.4. By all means back it up, so you can restore it if something goes wrong. You may have to manually override some parts of the installation that create and load the database, as you will have your own. Or, you can let it go ahead and create/load a new database (be careful that it's not the same name as the old one), and then in configure.php files switch over to the old database.

 

WinMerge is a very useful tool for comparing two files and taking action to merge differences into either or both. It gives you a side-by-side view of the two, highlighting differences, and lets you copy and paste from one into the other.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...