Hi,
I just upgraded ZP from 1.0.8 to 1.1.3 following the instructions provided in the documentation.
Here is a summary of the issues I had :
1) During upgrade :
About to update tables...
Cleaning up...
Warning: rmdir(/mnt/web3/31/21/51569621/htdocs/photos/cache/abbaye-de-valmagne) [function.rmdir]: File exists in /mnt/web3/31/21/51569621/htdocs/photos/zp-core/class-gallery.php on line 438
Warning: rmdir(/mnt/web3/31/21/51569621/htdocs/photos/cache/30-ans-besse) [function.rmdir]: File exists in /mnt/web3/31/21/51569621/htdocs/photos/zp-core/class-gallery.php on line 438
Warning: rmdir(/mnt/web3/31/21/51569621/htdocs/photos/cache/chateau-de-cassan) [function.rmdir]: File exists in /mnt/web3/31/21/51569621/htdocs/photos/zp-core/class-gallery.php on line 438
Warning: rmdir(/mnt/web3/31/21/51569621/htdocs/photos/cache/au-petit-boulanger) [function.rmdir]: File exists in /mnt/web3/31/21/51569621/htdocs/photos/zp-core/class-gallery.php on line 438
I'm not sure that this is a real problem since images display correctly.
2) After upgrading :
-The accented characters are replaced by something else (example : "Palais Idéal du Facteur Cheval") everywhere (title, comments, description).
-I noticed some javascript errors under IE6 (differents errors in Admin section and in Gallery). They don't have any impact though.
-Parameters defined previously in zp-config.php are lost (web site title, number of images per page ...). Not really a problem but worth to know before upgrading.
-Cannot open the "Image info" link : nothing happens, no error. Maybe something with IE6 again ? Is it because I did not refreshed the EXIF info ?
-Album and image sort orders are lost and seem to be sorted randomly. This is where I wonder if the upgrade has really succeeded.
Could you plase tell me if there is a problem with the upgrade process or if I did something wrong ?
Thanks in advance.
Comments
#2.
-Others have reported the accent character issue. It is under investigation.
-The JS errors seem to be an IE issue with the ajax scripts. They do not seem to be causing any real problems.
-The old zp-config parameters should have been carried over if you copied your old zp-config.php file to the new installation. Anyway, it is too late to do anything about that now.
-"Image info" works on IE7 and FireFox, so it is probably an IE6 issue.
-Don't know why the sort order would have been lost except if it had not really been set in the first place. Anyway, there are lots of new sorting options, so you can easilyl get the order you want.
I do not think you did anything wrong.
Related to the accent character issue, I just modified 3 php files (classes.php, class-album.php, class-image.php) as a workaround. I modified less than 10 lines of code so that the UTF-8 characters stored in database are displayed correctly and then I added a conversion to UTF-8 for any update.
My code is not a fix but a workaround for the ones (like me) who cannot wait the 1.2 version.
I can share the changes if any of you is interested.
**class-image.php
179c179
< function getAlbumName() { return $this->album->name; }
---
> function getAlbumName() { return utf8_decode($this->album->name); }
182c182
< function getTitle() { return $this->get('title'); }
---
> function getTitle() { return utf8_decode($this->get('title')); }
186c186
< function getDesc() { return $this->get('desc'); }
---
> function getDesc() { return utf8_decode($this->get('desc')); }
**class-album.php
122c122
< function getTitle() { return $this->get('title'); }
---
> function getTitle() { return utf8_decode($this->get('title')); }
126c126
< function getDesc() { return $this->get('desc'); }
---
> function getDesc() { return utf8_decode($this->get('desc')); }
**classes.php
242c242
< $sql .= "'" . mysql_escape_string($value) . "'";
---
> $sql .= "'" . utf8_encode(mysql_escape_string($value)) . "'";
261c261
< $sql .= " `$col` = '". mysql_escape_string($value) . "'";
---
> $sql .= " `$col` = '". utf8_encode(mysql_escape_string($value)) . "'";
I have no idea if it is coded correctly or not.
I checked that the display of albums and images are OK for accented characters.
I also checked that the update of album title/desc and image title/desc.
I did not check if the creation of an album works or not with accented characters.
Thanks for posting your solution. I've tried using it and zenphoto still nukes anything that's not latin1 - all I can see in a gallery that used to have a lot of cyrillic desc and comments are ?????.
Anybody else has an idea on how to work around 1.1.3 bugginess?
Downloading now... Thanks for looking into this. I'll report back asap.
sbillard may know more about that since he already worked on the problem.
I added a couple of the descriptions recently and the newly added ones show up in the zenphoto, but in the database they are garbled like Ñõûúð тþ чтþ ýðôþ. Those that I can read in the phpmyadmin look like ??????? in zenphoto. All charsets and collations are utf8_general_ci in the database and tables.
The workaround may be applicable only if the original text is encoded in UTF8 or latin1. The php doc reads : "utf8_decode — Converts a string with ISO-8859-1 characters encoded with UTF-8 to single-byte ISO-8859-1".
The fact phpmyadmin shows newly added comments as Ñõûúð тþ чтþ ýðôþ is normal since everything is encoded in UTF8 in database with the workaround. Your phpmyadmin is certainly configured for displaying eastern european languages, that's why you can read old comments but not UTF8 encoded ones. You can override that in Firefox by changing the Character encoding option (menu View).
Back to your initial problem, I don't know if you had better converting everything in database to UTF8 (and using the workaound) or using other php function for cyrillic languages instead of utf8_decode/encode (if they exist).
I've already done the conversions using queries like this
ALTER TABLE `albums` CHANGE `desc` `desc` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL
Second question : were the old comments consistent with the initial character set of the columns or not ? As far as I know, MySQL does not prevent you from encoding and storing text in latin1 even if the column character set is UTF8.
``
to the header of image.php, album.php, index.php, search.php etc.. etc..
hope this helps.. tho don't think it will fix the database storing issue you mentioned you had, if you still have it.. but it will help the browser display the characters properly :]
Database, tables, Zenphoto and Webpages are all set to work in Utf-8.
By the way I have Texpattern (Utf-8) on the same site/database and it works all right: French and CJK look all right everywhere, website and database.
So, I really don't know what the problem is...
Thanks to anyone who could help. Otherwise, I'll just have to stick to 1.4 forever. ;-)
but when i open it in database(phpmyadmin) > all characters display correctly
now, every time i load Zenphoto page , I have to chage "characters encoding" from utf8 to Windows(Thai) everytime
how to fix this problem ?
And it worked all right till I upgraded to 1.4
I didn't change anything during the upgrade, so something must has gone wrong when upgrading database's tables. But what? That is the question.