Hi,
I've just installed the latest version (1.3.1 [5736]) on my server and I keep getting this error on my admin page and on my gallery page:
Warning: array_shift() [function.array-shift]: The argument should be an array in /nfs/c02/h08/mnt/30806/domains/photos.pedramtorbati.com/html/zp-core/functions-i18n.php on line 470
Here are 2 pics that show the error:
http://www.pedramtorbati.com/errors/ I searched the forum and although this error came up in the past it doesn't resolve for me.
My server is running: PHP 5.2.6 and mySQL 4.1.25
Love the program, would be great to fix this small issue! Thanks you in advance...
Comments
Basically, the database conatins something that appears to be a multilingual string but is not.
Thank you for getting back to me about this issue. I'll be honest, i'm rather new to all this so please excuse my ignorance. Can you explain what you mean more specifically? When you say rename "them", what is "them"? Do you mean I need to change code in the admin.php file?
FYI - I downloaded zenphoto again from your site, installed it from scratch to a new URL and created a new My SQL database and got the same issue.
Also, I have no idea if this matter but I checked the database on myPHPadmiin and saw that the tables have a mixed collation of "utf8_unicode_ci" and "latin1_swedish_ci". Is that what you mean by "multilingual string".
My apologies again for probably sounding uneducated. I know I'm in over my head but hoping to learn.
Well, he obviously meant the images. more exact their file names so they get fresh database entries.
Regarding multilingual strings: Zenphoto is capable of storing several language versions of one title or description of an images (or other items). These are stored in one databse field but as a serialized array so Zenphoto can pick the right language version. Something has been corrupted with that in your database somehow.
Let me clarify that those two images are just screen grabs. The problem showed up on my admin page header when I first finished the install (that's the screen grab from the first pic). Afterwards, I tested uploading a picture to a gallery and found that on the user side the heading of the webpage has the same error (second pic). I uploaded a new bigger screen grab which might explain this a little better: http://www.pedramtorbati.com/errors/Picture 3.png.
Basically from the first second i finished the install and i was directed to the admin page I saw this error at the top.
I posted my "functions-i18n.php" file here http://www.pedramtorbati.com/errors/ if you can to take a look at what could be corrupted. In case it was corrupted after the install, I tried taking the "functions-i18n.php" from the original software download folder from your site to overwrite the one that was on the server and it didn't fix it.
To give you more info I'm being hosted on a gridserver on mediatemple.net and from my research other users have had great success with zenphoto on media temple. That's how I was referred to your software.
I hope this helps.
Thanks,
p
If something is corrupted it would be an entry in your database. If the file is best is to try a reupload.
I don't know or ever heard of mediatemple since I am from Germany but I successfully installed Zenphoto on variouse (major) hosters over here without any problems.
This is an indication of a corrupt database entry--something that perports to be an array but is not. It is actully possible that the server/database configuration is causing this. What warning reports did Setup give you? Specifically check things like the database character set defaults.
If the database table fields are not UTF-8 then some characters with diacritical marks may cause it to choke. The symptom of this is truncation of the string at the offending character.
magic_quotes_gpc=Off
mbstring.internal_encoding=UTF-8
Once I added that code the setup let me go forward. Am I missing something here?
Here is the phpAdmin breakdown of the database I'm using: http://www.pedramtorbati.com/errors/Picture 8.png and one for the tables that were created: http://www.pedramtorbati.com/errors/Picture 7.png It shows that the collation for the tables are not all the same. They are not all UTF-8 unicode, for some reason some are latin1_swedish. These were automatically created by the setup so not sure why there is a difference here. Could this be the problem?
If your native language is English, then change those to UTF-8. (If not you will have to look at each value for diacritical marks as those will have to be re-done when the character set is changed.)
Setup does not change these fields for the above reason.
While you are at it, look at the images to see what their fields look like. We are looking for ones that start with "a:number:{". There should be a balanced set of braces, at least.
You will have to help me out on "balanced set of braces"...here are 3 screen grabs of the revised "images" table with all the fields:
http://www.pedramtorbati.com/errors/Picture 9.png
http://www.pedramtorbati.com/errors/Picture 10.png
http://www.pedramtorbati.com/errors/Picture 11.png
I really don't ned a multilingual site. I just need an english version to work if that makes any difference.
http://www.pedramtorbati.com/errors/browse-administrators.png
http://www.pedramtorbati.com/errors/browse-captcha.png
http://www.pedramtorbati.com/errors/browse-options.png
For all the other tables I got this error trying to browse them:
MySQL returned an empty result set (i.e. zero rows). (Query took 0.0022 sec)
All I can see is the "structure" of the table. Does this seem right?
The options table does have one of these serialized arrays. It is the "gallery_title" row (third row). Looking back at the images of the original error it is likely that this row it the source of the problem.
If you edit the row (click on the pencil icon) it will show the full text for the "value" field. Please report back that text. But also, clear the field to be empty and save the changes. If this is the only instance of the serialized array being corrupted, this will fix the problem.
http://www.pedramtorbati.com/errors/homepage.png
http://www.pedramtorbati.com/errors/album view.png
It seems we there is another bad value field somewhere that needs attention. Here is the value on the gallery_title row that was there before I deleted it:
a:12:{s:5:"en_US";s:7:"Gallery";s:5:"de_DE";s:7:"Galerie";s:5:"es_ES";s:8:"GalerÃa";s:5:"fr_FR";s:7:"Galerie";s:5:"gl_ES";s:8:"GalerÃa";s:5:"it_IT";s:8:"Galleria";s:5:"ja_JP";s:15:"?????";s:5:"nl_NL";s:7:"Galerij";s:5:"pl_PL";s:7:"Galeria";s:5:"sv_SE";s:7:"Galleri";s:5:"zh_CN";s:6:"??";s:5:"zh_TW";s:6:"??";}
So close!
For anyone else with very little coding knowledge that might come across this in the future, it seems that the best approach to solving this issue is to first make sure you have added a name to "gallery title" and "gallery description" in your admin. Then go to your database, click on the "options" table, then click "browse" and make sure the "gallery_title" value is empty. If that doesn't work then make sure that all your tables are collated utf8_unicode_ci. If that doesn't work, then manually go inside each table and change any latin1 field to utf8. Hope this helps.
Thank you very much for all your help!! Glad to finally use this software the right way.
p
Saving new values for the title and descriptions eliminated the problem as those were not "multi-lingual".
I think latin1 was the key issue but it was painstaking to manually go and change all the fields in the tables (in the image table there are a lot of fields) so I would suggest someone start with the easy stuff first just in case the bad gallery_title value fixes it.
Let me know if you have any more insights and thanks again for all your help. I may end up having to reinstall everything from scratch to figure out why I can't use ImageMagick and if I do I will test out whether latin1 is the cause. Hopefully it won't come to that though...
p
You should check to see if there are any other DB fields that are latin1 and change the to UTF8. I am sure the Imageick problem is unrelated.