select * from zp_albums again

Hi,

I just installed the latest version from trunk and got this in my queries again:

`

307 Query SELECT * FROM ``zp_albums` WHERE `parentid` IS NULL
307 Query SELECT * FROM `zp_albums`

I haven't debugged it yet maybe you know where the select comes from.

Thanks!

KR,

Grimeton

Comments

  • Hi,

    found it. It's method cache() from PersistenObject...

    KR,

    Grimeton
  • You do not say what you are running, but if it is not the development build then this is expected.
  • Hi,

    latest version from trunk, as I said before:

    `

    $ svn info trunk/

    Path: trunk

    URL: http://www.zenphoto.org/svn/trunk

    Repository Root: http://www.zenphoto.org/svn

    Repository UUID: 46129fc4-274e-7f48-8cfa-5da4c607681c

    Revision: 7829

    Node Kind: directory

    Schedule: normal

    Last Changed Author: acrylian

    Last Changed Rev: 7829

    Last Changed Date: 2011-07-30 13:04:17 +0200 (Sa, 30 Jul 2011)

    `

    The "problem" comes from the method cache() of PersistentObject.

    When the system tries to array_diff_assoc the two arrays for the Gallery, the array $cache_set is of size 0 (line 99 in classes.php), so the getWhereClause() function returns just nothing and "SELECT * from zp_albums;" is send to the database (line 118).

    I just changed line 117 from "} else {" to } elsif (sizeof($cache_set) > 0) {" to avoid queries without a where clause.

    cu

  • As said, use the dev branch
Sign In or Register to comment.