Forums / Upgrading to 1.5.x / collect_info.php

collect_info.php

Results 1 to 15 of 15
07 Feb 2012, 14:05
#1
tenerifetom avatar

tenerifetom

New Zenner

Join Date:
Dec 2004
Posts:
69
Plugin Contributions:
0

collect_info.php

the site has been working fine after the upgrade but to day it crashed i was at the time ajusting products in the store it started when i pressed update here is the error log
(mods note i have renamed admin i have edited the error log to show admin)

[07-Feb-2012 12:36:34] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/sites/mysite.co.uk/public_html/admin/includes/modules/product/collect_info.php on line 401
07 Feb 2012, 14:43
#2
tenerifetom avatar

tenerifetom

New Zenner

Join Date:
Dec 2004
Posts:
69
Plugin Contributions:
0

Re: collect_info.php

I have fixed this proplem to get the site back up i had to over write the /includes/modules/product/collect_info.php but I think there may still be a problem if it happens every time i edit exsisting products. the site was an upgrade from 138a to 1.50 so I know that the 138 version had a wysiwyg editor and i beleave this is the issue
24 Aug 2012, 01:22
#4
snowkrash avatar

snowkrash

New Zenner

Join Date:
Aug 2007
Posts:
65
Plugin Contributions:
0

Re: collect_info.php

DrByte:

See: https://www.zen-cart.com/tutorials/index.php?article=414


I'm getting the same error in my log, but how I got it was by trying to checkout. I got a blank screen and this error was collected in my debug log.

It is true I pulled the db in from 1.3.8 to 1.5 and I am in a staging area testing everything before I push it live.

I have read this article, but my settings in all of these files were already set to the ISO set and latin1.

I'm at a loss. I need to launch in a couple of days and I'm stuck with a blank page on checkout_shipping

Any ideas? Thanks in advance.
24 Aug 2012, 01:39
#5
snowkrash avatar

snowkrash

New Zenner

Join Date:
Aug 2007
Posts:
65
Plugin Contributions:
0

Re: collect_info.php

Let me add that I am also having the blank product description problem and the funky character problem as explained here:

http://www.zen-cart.com/showthread.php?194876-Upgrade-missing-product-descriptions-on-Admin-not-site-Fonts-a-bit-odd

So, if the answer is to follow the article about changing your files to reflect the ISO and latin1 set, but my files already have this, and my DB info I looked at in tools also says only ISO and latin1 settings, then what could be wrong?

I have pulled the DB in from 1.3.8 install into a fresh clean install of 1.5 - I have been going in to each product description, manually copying and pasting it from the old site (which is still live) and re-typing the quotes and the dashes and that seems to be working okay after I do that, but there are hundreds of products and I can't do it for hundreds of products. Is there some manual way to fix the /index.php?main_page=checkout_shipping page from going blank?

Thanks for taking a look!
24 Aug 2012, 03:51
#6
snowkrash avatar

snowkrash

New Zenner

Join Date:
Aug 2007
Posts:
65
Plugin Contributions:
0

Re: collect_info.php

I fixed the /index.php?main_page=checkout_shipping page from coming up blank by going to the shipping module and editing the module we are using (zones)... I clicked edit, but I didn't change anything, and simply hit update.

It seems I'll have to go through the site and MANUALLY re-save into the database everything! This is daunting. I may just go back to the old version if I can't find a way to fix this utf-8 issue across the site in the next 24 hours or so.

Thanks for checking this out, I wish I had a better solution to offer to others with this problem.
24 Aug 2012, 05:20
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: collect_info.php

You say you're staging this in a testing environment. Fortunately that gives you time to sort out whatever issues might be triggering your unusual circumstances.

If your data was exported-and-then-imported, then perhaps whatever tools were used to do the export didn't manage character sets properly, and resulted in damaged data. Such as the import treating the data in the opposite character set to what it ought to.

Or, in some cases people have been absolutely emphatic that their english.php and configure.php files are correct but when finally convinced to triple-check they discover that the files on the server are in fact NOT what they thought.

Can you tell us what version of PHP your webserver is using?
25 Aug 2012, 10:09
#8
snowkrash avatar

snowkrash

New Zenner

Join Date:
Aug 2007
Posts:
65
Plugin Contributions:
0

Re: collect_info.php

Thanks for responding!

I am on PHP Version: 5.2.17 (Zend: 2.2.0) - MySQL 5.0.92

I used phpmyadmin to export the DB from a 1.3.8 version of zen cart. I looked in update instructions online before I did that, hoping to find a clue as to what charset to use, and I ended up finding this: http://www.zen-cart.com/content.php?144-how-can-i-do-a-database-backup-with-phpmyadmin that stepped me through exporting the zen cart DB and importing to my fresh install of 1.5. I followed those instructions precisely, so I don't think I had a choice of Charset in that process. When I imported the data, everything seemed fine. Then I saw the funny characters in the product descriptions, went to change them and found the description window in the admin to be blank. I fixed it only by copying the data from the live site, pasting it, then manually replacing the dashes and quotes. Then I noticed the blank pages in the checkout process. I found this thread. I triple-checked the english.php and configure.php files. I found only one instance of charset utf-8 and that was in the [myadminname]/includes/configure.php so I changed it by copying and pasting the iso string directly from the live site's entry in the same file, to be sure I do not make a typo. I emptied my browser cache, restarted my machine to be sure, and the blank pages still came up. I then found a thread where you insisted that with a fresh install of 1.5, you are sure that the files are utf-8 by default (I also found that in the installation folder I saved on my hard drive). This made me wonder if the reason I had only one instance of the utf-8 (I even did a number of searches of the code in the site to find every mention of utf-8), was possibly because my fresh install was done with a one-button click wizard process on GoDaddy - so maybe godaddy's install script changes those entries once the database for it is created???? I don't know but honest to god, I had only one instance of utf-8. I even looked to be sure each file had the entries to begin with and they were not simply missing.

So, that's where I am now. I'm doing a ton of use cases testing to see if I run into anymore blank pages, and I am manually one-by-one going through the products in the admin area looking for blank windows and copying and pasting and changing. The rough part about this is that my client is not going to pay me to sit here at $80/hr and do this. And I want to make this site okay for them, so I am doing basically hundreds of dollars of work for free and I can't afford that. I've got projects starting that I can't put off. I'm thinking that if I keep the old site in a hidden area and launch this one, that once someone needs to go into the admin to change anything in the description and they get a blank window, they'll just have to go to the old site at that time and grab the data. I'm only hoping it's not affecting something I can't see yet - like I just noticed it's not adding tax to taxable items, and I suspect this database issue, so now I need to figure out what I need to find in the admin that I need to hit edit and then save to see if that helps. I may cry.

Thank you for any direction you can blow me in.
25 Aug 2012, 11:06
#9
snowkrash avatar

snowkrash

New Zenner

Join Date:
Aug 2007
Posts:
65
Plugin Contributions:
0

Re: collect_info.php

Let me add - this is what I have in both configure files in /includes/ and in /[myadminname]/includes/

define('DB_TYPE', 'mysql');
define('DB_PREFIX', 'zen_');
define('DB_CHARSET', 'latin1');

and in english.php in /includes/languages/

@setlocale(LC_TIME, 'en_US.ISO_8859-1');
and
// charset for web pages and emails
define('CHARSET', 'iso-8859-1');
25 Aug 2012, 11:48
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: collect_info.php

Almost certainly it's a character mismatch in your exported data.

When you look in phpMyAdmin at your old database, what collation/characterset is assigned to all the tables?
And how about the new one?

I suspect you've taken latin1 data which unfortunately contains multibyte characters, exported it and saved it in a default iso-8859-1 encoded file, then imported it into a utf8 database and are treating it as latin1, hence the display of invalid characters.

I also suspect that when you it comes time to "go live", if you actually do the upgrade directly to the live database instead of exporting and importing, that everything will be fine, because you're not tampering with the data by moving it into an export file and back again where it can get messed up.
I can't guarantee it, but it's a gut feeling.
25 Aug 2012, 12:56
#11
snowkrash avatar

snowkrash

New Zenner

Join Date:
Aug 2007
Posts:
65
Plugin Contributions:
0

Re: collect_info.php

Okay, so I went into both databases with phpmyadmin and right on the front page for both it says:

MySQL charset: UTF-8 Unicode (utf8)

So, isn't this good news, can I just go to my files now and change everything to UTF-8 and it will work?

I've made a week of changes to the database including manually adding about 50 new products at this point, so I will simply be launching by pointing the domain to this new install, as the only change to the live DB since I exported has been a few orders and the client is ok with that. There will be no further importing/exporting, and I mean over my dead body will exporting/importing take place after this.

I realize now that it's critical that I fix this - I just discovered that in the admin it won't load newsletter subscribers nor will it load the customers on the export email addresses tool I just installed with your 1.5 update to that mod... so there is a data problem in those tables.

I'm going to try changing my files to UTF-8 and see what happens. Is it technically possible that doing so will actually alter the data in any way?

Thanks again.
25 Aug 2012, 14:41
#12
snowkrash avatar

snowkrash

New Zenner

Join Date:
Aug 2007
Posts:
65
Plugin Contributions:
0

Re: collect_info.php

Okay, so I changed all entries to utf-8 and one good thing I see is that the content windows on the edit product page are no longer blank if they contain a funny character. This is great, as this means that if a character needs to be changed, the product's info is still there and the character may just be changed. Whew!

Sadly, the odd characters are still there. This is not a show-stopper, as they pop up mainly in the last lines of the description, replacing a quotation mark.

The customer list still comes in fine and so do orders it seems, plus, the tax is working now, but the email address retrieval still is choking. This all leads me to wonder if the data was saved in ISO but the data was initially utf-8, and now I simply have ISO data in a utf-8 server - do you know of a script that could convert that data to utf-8 and if so, am I playing with fire going down that road?

Thanks!
25 Aug 2012, 18:45
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: collect_info.php

There are tons of such conversion scripts in the wild. And most of them result in a mangled damaged database that's worse off than before the script was run.
Definitely proceed with caution.

And yes, you do have a problem. Despite your database being set to expect utf8 data when it was first created, your Zen Cart was configured instead to store the data as latin1/iso-8859-1. So your utf8 database has characters in it that would become different characters if you just flipped some switch to try to magically change things. Preserving the data correctly is a challenge.
Doing such a conversion is risky.

Whatever way you approach it, you MUST test test test test test test test every record in every field in every table in your database.
26 Aug 2012, 09:34
#14
snowkrash avatar

snowkrash

New Zenner

Join Date:
Aug 2007
Posts:
65
Plugin Contributions:
0

Re: collect_info.php

Okay, so I found one that you did:

http://www.zen-cart.com/downloads.php?do=file&id=1280

And I ran that. All my stuff is completely utf-8 now. The only problem I found after that (apart from the email problem) was that the funky characters were not only gone in the description window, but all text after the first instance of the funky character was also gone. I sat here for 12 hours and paid someone to help me, and we manually inserted the data from the old site, manually changing the characters. It's all good now, and I am fully utf-8. A painful road, I still am not sure how I could have avoided, but for having full instructions and a proper tool before beginning the database export.

I still had the newsletter problem, but that seems to be dealt with in another thread - I had the mod Newsletter Subscribe, and now I don't because there isn't one for 1.5 yet. I will address that issue elsewhere.

Thank you for your help!
05 Jan 2013, 17:52
#15
noobgal avatar

noobgal

New Zenner

Join Date:
Jun 2010
Posts:
27
Plugin Contributions:
0

Re: collect_info.php

I am also having this exact same problem. I followed he tutorial DrByte linked to as my configure.php files didn't have an entry for charset. I also updated the english.php as per instructions. This has not worked, I still get the message "WARNING: An Error occurred, please refresh the page and try again." when I try to add a new product.

I have checked the logs and I get the same error message as tenerifetom in my logs.

I have gone into myphp admin and checked to see what my tables for my old and new database are set to. They are all set to latin1 in the old database, however in the new database they are all latin1 apart from four tables which don't exist in my old database. They are admin_menus, Admin_Pages, Admin_pages_to_profiles and admin_profiles. My site was working fine after the upgrade and I was able to add new products. I have been using the apsona add in on my old site and copied the files over for the add onto my new site and I was able to import products using apsona successfully. However this has all suddenly stopped working now and I am at a total loss as to what has gone wrong. I have emailed apsona support as initially I thought it was their mod because I couldnt update products with the add in, however on further investigation I can no longer add new products in the admin area. Is something corrupt, seems strange that it was all working on 1.5 for a few days and now its not. Any advice or suggestions would be appreciated, please bear with me as I am a new zenner and not up to speed with everything yet.