Errors saving theme options on zenphoto 1.4

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])

Comments

  • 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
    `
  • acrylian Administrator, Developer
    Your file/folder permissions are not set correctly. Setup should have reported about that. Also please see the troubleshooting on what to set these to manually if needed.
  • 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 name, value, id FROM zzp_options WHERE name='Allow_search' AND ownerid= AND theme='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 theme='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
  • Right I was being stupid, I just realised that zenphoto doesn't recognise tiffs - so scrub my last comment.

    My bad

    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,

    Found something else.

    If I go "options">"theme" and hit "apply", I don't get the error message.
    If however I go "themes">"Set Default theme options" and hit "apply" I do get the error message.

    P
  • Can you copy the address bar of the page when you have got there by the themes->set default theme options? So far I have not been able to reproduce this, even with a clean install doing nothing but themes->set default theme options/apply
  • 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
  • Regards your problme with TIFF files. Problem really is that the PHP GD library does not support them. If you have Imagick on your server, you can configure Zenphoto to use it. It supports TIFF.
  • Hi,
    It was easy enough to batch convert them to jpgs. Thanks for the info though.

    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
  • acrylian Administrator, Developer
    Sorry, the link is somehow wrong, it's http://www.zenphoto.org/trac/ticket/1776
  • Hi,

    I went over to ticket 1776 but it seems that I can only view the ticket.

    It won't let me log on and I can't see how to add an attachment, nor can I see your attachment. I had a read of the Trac Wiki but I'm none the wiser.

    What I'm doing wrong?

    P
  • fretzl Administrator, Developer
    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 ;-)
  • acrylian Administrator, Developer
    Sorry, I confused the 1.4 bugfix ticket with this one...
  • Hi,

    Thanks. I've downloaded the modified admin-options.php and that's fixed the error. Thank you for sorting it out so quickly - it's very much appreciated.

    I still don't know how to upload my original admin-options.php though as requested by sbillard.

    P
  • fretzl Administrator, Developer
    Did you register for Track ?
    (via the `register` link in the upper right corner of Track)
  • Thank you!

    Uploaded the file.

    P
  • Some more good news. I don't know why the editors we use disaagree on the line numbers, but the file you uploaded matches the one I was using (and the code insertion point is as I posted).

    I have closed the ticket and added the file to the 1.4 butfix ticket.
Sign In or Register to comment.