Hi,
I've just done a completely fresh install of Zenphoto 1.4. Whenever I try and save any changes to the themes I get the error message that I've copied and pasted later on.
Just to clarify, this occurs when pressing "theme options" and then "apply" for the Default, Effervesence+ and StopDesign themes that are included in the download. I haven't modified these in any way.
Any idea what's going on? Thanks
P
Zenphoto encountered an error
MySQL Query ( SELECT name, value, id FROM zp2_options WHERE name='Allow_search' AND ownerid= AND theme='default' ) failed. MySQL returned the error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND theme='default'' at line 1
Backtrace:
-> query (functions-db-MySQL.php [90])
-> query_single_row (functions.php [1937])
-> setThemeOption (admin-functions.php [857])
-> processCustomOptionSave (admin-options.php [414])
This is surly the down-stream effect of some other error. Please look at your error logs and report what they show.
see also http://www.zenphoto.org/support/topic.php?id=8542#post-50456
Hi,
I checked the error logs and I found this, although I don't know if it's useful or not, nor what it is that needs fixing. I also read the other thread and I too had warnings about gettext(). I figured that because it was a warning rather than an error it was safe to ignore. Is that where I've gone wrong?
P
[Wed Jan 05 21:54:55 2011] [error] [client ::1] PHP Warning: copy(/Users/myuser/Sites/zenphoto2/.htaccess): failed to open stream: Permission denied in /Users/myuser/Sites/zenphoto2/zp-core/setup.php on line 260 [Wed Jan 05 21:54:55 2011] [error] [client ::1] PHP Warning: file_put_contents(/Users/myuser/Sites/zenphoto2/robots.txt): failed to open stream: Permission denied in /Users/myuser/Sites/zenphoto2/zp-core/setup.php on line 1254 [Wed Jan 05 21:54:56 2011] [error] [client ::1] File does not exist: /Users/myuser/Sites/zp-core, referer: http://localhost/~myuser/zenphoto2/zp-core/setup.php [Wed Jan 05 21:56:09 2011] [error] [client ::1] PHP Warning: file_put_contents(/Users/myuser/Sites/zenphoto2/robots.txt): failed to open stream: Permission denied in /Users/myuser/Sites/zenphoto2/zp-core/setup.php on line 1254, referer: http://localhost/~myuser/zenphoto2/zp-core/setup.php [Wed Jan 05 21:56:17 2011] [error] [client ::1] PHP Warning: file_put_contents(/Users/myuser/Sites/zenphoto2/robots.txt): failed to open stream: Permission denied in /Users/myuser/Sites/zenphoto2/zp-core/setup.php on line 1254, referer: http://localhost/~myuser/zenphoto2/zp-core/setup.php [Wed Jan 05 21:56:28 2011] [error] [client ::1] PHP Warning: copy(/Users/myuser/Sites/zenphoto2/.htaccess): failed to open stream: Permission denied in /Users/myuser/Sites/zenphoto2/zp-core/setup.php on line 260, referer: http://localhost/~myuser/zenphoto2/zp-core/setup.php?xsrfToken=87f26fe5192aea42e2c1cd6cee2fa34e&charset_attempts=5&FILESYSTEM_CHARSET=UTF-8 [Wed Jan 05 21:56:28 2011] [error] [client ::1] PHP Warning: file_put_contents(/Users/myuser/Sites/zenphoto2/robots.txt): failed to open stream: Permission denied in /Users/myuser/Sites/zenphoto2/zp-core/setup.php on line 1254, referer: http://localhost/~myuser/zenphoto2/zp-core/setup.php?xsrfToken=87f26fe5192aea42e2c1cd6cee2fa34e&charset_attempts=5&FILESYSTEM_CHARSET=UTF-8 [Wed Jan 05 21:56:35 2011] [error] [client ::1] PHP Warning: file_put_contents(/Users/myuser/Sites/zenphoto2/robots.txt): failed to open stream: Permission denied in /Users/myuser/Sites/zenphoto2/zp-core/setup.php on line 1254, referer: http://localhost/~myuser/zenphoto2/zp-core/setup.php?copyhtaccess [Wed Jan 05 21:56:47 2011] [error] [client ::1] PHP Warning: file_put_contents(/Users/myuser/Sites/zenphoto2/robots.txt): failed to open stream: Permission denied in /Users/myuser/Sites/zenphoto2/zp-core/setup.php on line 1254, referer: http://localhost/~myuser/zenphoto2/zp-core/setup.php?xsrfToken=d7cd026c180078fade714d53a17f435b&chmod_permissions=2 [Wed Jan 05 21:56:47 2011] [error] [client ::1] script '/Users/myuser/Sites/zenphoto2/zp-core/setup_permissions_changer.php' not found or unable to stat, referer: http://localhost/~myuser/zenphoto2/zp-core/setup.php?xsrfToken=12c0f0e0755909b656a729c7a15a3ad3&chmod_permissions=1 [Wed Jan 05 21:56:47 2011] [error] [client ::1] script '/Users/myuser/Sites/zenphoto2/zp-core/setup_permissions_changer.php' not found or unable to stat, referer: http://localhost/~myuser/zenphoto2/zp-core/setup.php?xsrfToken=12c0f0e0755909b656a729c7a15a3ad3&chmod_permissions=1 [Wed Jan 05 21:56:47 2011] [error] [client ::1] script '/Users/myuser/Sites/zenphoto2/zp-core/setup_permissions_changer.php' not found or unable to stat, referer: http://localhost/~myuser/zenphoto2/zp-core/setup.php?xsrfToken=12c0f0e0755909b656a729c7a15a3ad3&chmod_permissions=1 [Wed Jan 05 21:56:47 2011] [error] [client ::1] script '/Users/myuser/Sites/zenphoto2/zp-core/setup_permissions_changer.php' not found or unable to stat, referer: http://localhost/~myuser/zenphoto2/zp-core/setup.php?xsrfToken=12c0f0e0755909b656a729c7a15a3ad3&chmod_permissions=1 [Wed Jan 05 21:56:47 2011] [error] [client ::1] script '/Users/myuser/Sites/zenphoto2/zp-core/setup_permissions_changer.php' not found or unable to stat, referer: http://localhost/~myuser/zenphoto2/zp-core/setup.php?xsrfToken=12c0f0e0755909b656a729c7a15a3ad3&chmod_permissions=1 [Wed Jan 05 21:56:47 2011] [error] [client ::1] script '/Users/myuser/Sites/zenphoto2/zp-core/setup_permissions_changer.php' not found or unable to stat, referer: http://localhost/~myuser/zenphoto2/zp-core/setup.php?xsrfToken=12c0f0e0755909b656a729c7a15a3ad3&chmod_permissions=1 [Wed Jan 05 21:57:08 2011] [error] [client ::1] PHP Warning: copy(/Users/myuser/Sites/zenphoto2/.htaccess): failed to open stream: Permission denied in /Users/myuser/Sites/zenphoto2/zp-core/setup.php on line 260, referer: http://localhost/~myuser/zenphoto2/zp-core/setup.php?xsrfToken=12c0f0e0755909b656a729c7a15a3ad3&chmod_permissions=1 [Wed Jan 05 21:57:08 2011] [error] [client ::1] PHP Warning: file_put_contents(/Users/myuser/Sites/zenphoto2/robots.txt): failed to open stream: Permission denied in /Users/myuser/Sites/zenphoto2/zp-core/setup.php on line 1254, referer: http://localhost/~myuser/zenphoto2/zp-core/setup.php?xsrfToken=12c0f0e0755909b656a729c7a15a3ad3&chmod_permissions=1
Hi,
Thanks for the help. Unfortunately I can only get it to work by setting everything to 777 (which is clearly bad). The errors in the console log disappear but I still get the same problem as before, that is when I change the options for a theme and hit apply I get
`
Zenphoto encountered an error
MySQL Query ( SELECT [code]name[/code], [code]value[/code], [code]id[/code] FROM [code]zzp_options[/code] WHERE [code]name[/code]='Allow_search' AND [code]ownerid[/code]= AND [code]theme[/code]='zenpage' ) failed. MySQL returned the error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND [code]theme[/code]='zenpage'' at line 1
Backtrace:
-> query (functions-db-MySQL.php [90])
-> query_single_row (functions.php [1937])
-> setThemeOption (admin-functions.php [857])
-> processCustomOptionSave (admin-options.php [414])
`
Also when I upload a folder of images to "albums", zenphoto sees the folder name but not any of the pictures within it. Again this is with everything set to 777 and no errors in any log.
P
Hi,
I found a couple of more errors in the log which might help? Thanks
P
[Thu Jan 06 15:20:18 2011] [error] [client ::1] PHP Warning: get_class() expects parameter 1 to be object, string given in /Users/myuser/Sites/zenphoto/zp-core/functions.php on line 1653 [Thu Jan 06 15:20:18 2011] [error] [client ::1] PHP Fatal error: Call to a member function get() on a non-object in /Users/myuser/Sites/zenphoto/zp-core/template-functions.php on line 1560
Hi,
The address bar says
http://localhost/~myuser/zenphoto/zp-core/admin-themes.php
I scroll down to "Default Theme" and select "Set Default Theme Options" which takes me to
http://localhost/~myuser/zenphoto/zp-core/admin-options.php?page=options&tab=theme&optiontheme=default
Thanks
P
Well, that URL did not make it fail for me. Can you do the following:
inserte between lines 348 and 349 of admin-options.php (just above the line that reads if ($themeswitch) { the following.
debugLogArray("save theme options '_POST'", $_POST); debugLogVar('themealbum',$themealbum);
Be sure you have no debug_lot.txt file in your zp_data folder. Then make the error occur. This will produce some debug information that hopefully will be of help.
Hi,
I did that (although I had to insert it between lines 343 & 344 on my admin-options.php) and after the error occurred, this is the contents of the debug file ...
{Thu, 06 Jan 2011 22:14:13 GMT} Zenphoto v1.4[6454] save theme options '_POST' => ( savethemeoptions => yes, optiontheme => effervescence_plus, old_themealbum => , themealbum => , albums_per_row => 3, albums_per_page => 5, images_per_row => 4, images_per_page => 15, thumb_transition => 2, thumb_size => 150, thumb_crop_width => 7.3333333333333, thumb_crop_height => 7.3333333333333, image_size => 600, image_use_side => height, custom_index_page => , _ZP_CUSTOM_chkbox-Allow_search => 0, Allow_search => 1, _ZP_CUSTOM_custom-effervescence_menu => 0, _ZP_CUSTOM_chkbox-effervescence_daily_album_image => 0, effervescence_daily_album_image => 1, _ZP_CUSTOM_custom-Graphic_logo => 0, Graphic_logo => *, _ZP_CUSTOM_selector-effervescence_daily_album_image_effect => 0, effervescence_daily_album_image_effect => , _ZP_CUSTOM_chkbox-Slideshow => 0, Slideshow => 1, _ZP_CUSTOM_custom-Theme_colors => 0, Theme_colors => oktoberfest, _ZP_CUSTOM_text-Theme_logo => 0, Theme_logo_en_US => , _ZP_CUSTOM_selector-Theme_personality => 0, Theme_personality => Image page, _ZP_CUSTOM_chkbox-Watermark_head_image => 0, Watermark_head_image => 1, _ZP_CUSTOM_chkbox-enable_album_zipfile => 0 ) themealbum object(Album)#8 (29) { ["name"]=> string(0) "" ["localpath"]=> string(37) "/Users/zacadim/Sites/zenphoto/albums/" ["exists"]=> bool(true) ["images"]=> NULL ["subalbums"]=> NULL ["parent"]=> NULL ["parentalbum"]=> NULL ["gallery"]=> object(Gallery)#9 (6) { ["albumdir"]=> string(37) "/Users/zacadim/Sites/zenphoto/albums/" ["albums"]=> NULL ["options"]=> NULL ["theme"]=> NULL ["themes"]=> NULL ["lastalbumsort"]=> NULL } ["searchengine"]=> NULL ["index"]=> NULL ["themeoverride"]=> NULL ["lastimagesort"]=> NULL ["lastsubalbumsort"]=> NULL ["albumthumbnail"]=> NULL ["sidecars"]=> array(1) { ["xmp"]=> string(3) "xmp" } ["manage_rights"]=> int(8388608) ["view_rights"]=> int(512) ["comments"]=> NULL ["commentcount"]=> NULL ["data"]=> array(2) { ["folder"]=> string(0) "" ["id"]=> string(0) "" } ["updates"]=> array(0) { } ["loaded"]=> bool(true) ["table"]=> string(6) "albums" ["unique_set"]=> array(1) { ["folder"]=> string(0) "" } ["cache_by"]=> string(6) "folder" ["id"]=> string(0) "" ["use_cache"]=> bool(true) ["transient"]=> bool(true) ["tempdata"]=> array(0) { } }
Thanks
P
It is a bit disturbing that the line numbers are so different. I did check the 1.3.1.2 release and the place on it would be lines between lines 329 and 330.
If there is some code missing, then that would explain things. (But how that could happen is beyound me.)
I've created a ticket for this problem, we can continue the debug there. http://www.zenphoto.org/trac/ticket/1790. I've attached a modified admin-options.php script there. From looking at your debug output, the "album" for the theme is really screwed up. (Of course there should be none in the first place, but that is maybe a different story.)
The attached script should at least detect that the album is not valid and clean things up accordingly. I'd appreciate it if you would attach your copy of admin-options.php to the ticket so I can try to see why the line numbers are different. Maybe also tell me what file you release file downloaded and from where.
Hi,
The version of zenphoto I have is
"Zenphoto version 1.4 [6454] (Official Build)"
and it was downloaded from http://zenphoto.googlecode.com/files/zenphoto-1.4.zip.
I tried clicking the http://www.zenphoto.org/trac/ticket/1790 link in your post but I got a ticket not found. I could post the contents of my admin-options.php file in here if that helps?
P
Sorry, the link is somehow wrong, it's http://www.zenphoto.org/trac/ticket/1776
Actually, http://www.zenphoto.org/trac/ticket/1790 is correct.
I just left a comment there.
P.S. You have to register for Track to post or upload ;-)