USER ERROR after upgrade 1.4.9

Hi,

I just did an upgrade and after finishing the setup I'm not able to see any images or subalbums within the main album. Debug.log notes the following error.

USER ERROR: MySQLi Error: ( SELECT * FROM ``[prefix]images`WHERE`albumid`= 3 ORDER BY show ) failed. MySQLi 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 'show' at line 1 in ...../paledog.de/www/zp-core/functions-db-MySQLi.php on line 78

trigger_error called from query (functions-db-MySQLi.php [78])

from AlbumBase->sortImageArray (class-album.php [1042])

from Album->getImages (class-album.php [1324])

from admin-edit.php [607]

Any idea what might have caused this? Actually i did not delete the zp-core folder but rather have overwritten it.

PHP version is 5.4.40
MySQLi version 5.5.38

Comments

  • The following function has been changed in functions-db-MySQLi.php for 1.4.9 (if that helps)

    NEW:
    function db_quote($string, $addquotes = true) {
    global $_zp_DB_connection;
    $escaped = $_zp_DB_connection->real_escape_string($string);
    if ($addquotes) {
    return "'" . $escaped . "'";
    } else {
    return $escaped;
    }
    }

    OLD:
    function db_quote($string) {
    global $_zp_DB_connection;
    return "'" . $_zp_DB_connection->real_escape_string($string) . "'";
    }

    I might try to use the old version of this file. However it works in my test environment with the new one. It appears that the MySQLi-version has to do something with it.
    Test environment comes with 5.6.17
  • acrylian Administrator, Developer
    I believe that has been fixed in the support build.
  • Yes. It works now.

    By the way, if you run the setup of the support build it complains about missing files:
    themes/zenpage/contact_form
    themes/zenpage/contact_form/form.php
    themes/zenpage/test.php

    This is not a problem for now but you might want to check it.
  • acrylian Administrator, Developer
    Thanks for the note. Accidentally test files sneaked into the file catalogue…
  • Hi Guys,

    this already fixed bug took me some time to locate.

    To upgrade my installation, I downloaded version 1.4.9 with the download link on the download page (https://github.com/zenphoto/zenphoto/archive/zenphoto-1.4.9.tar.gz) and got the buggy version. Downloading the zenphoto-master.zip worked :)

    As this bug doesn't appear in any theme, only few installations might be affected.

    Nevertheless updating the link/package would perserve other ones from struggeling with this issue too.

    Regards
    Markus
  • acrylian Administrator, Developer
    The bug actually only occurs on certain sorting settings which is why it took some time to reproduce it at all.

    The link will be updated as soon as there is an official follow up release.
  • Hello arylian,
    i have the same problem.

    USER ERROR: MySQLi Fehler: (SELECT `folder`, `filename` FROM `[Vorsilbe]images`, `[Vorsilbe]albums` WHERE `[Vorsilbe]albums`.folder!="" AND `[Vorsilbe]images`.albumid = `[Vorsilbe]albums`.id AND `[Vorsilbe]albums`.id IN) AND `[Vorsilbe]images`.show=1 ORDER BY RAND()) fehlgeschlagen. MySQLi gab den Fehler 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 `_images`.show=1 ORDER BY RAND()' at line 1 zurück in /mnt/webt/e3/26/56758126/htdocs/zp-core/functions-db-MySQLi.php in Zeile 78

    trigger_error called from query (functions-db-MySQLi.php [78])

    from getRandomImagesAlbum (template-functions.php [3332])

    from printRandomImages (template-functions.php [3380])

    from include (inc-sidebar.php [21])

    from include (image.php [2])

    from include (index.php [129])

    from index.php [28]
    happend, when i want go to the next site of the galery.
    in adminmodus i have 12 album, official only 4
  • acrylian Administrator, Developer
    As mentioned it was fixed in the master already which is now the just released 1.4.10 update. Please try that.
Sign In or Register to comment.