[dev] Datatree_sql::getByAttributes question
Michael Rubinsky
mike at theupstairsroom.com
Thu Jun 21 17:27:27 UTC 2007
I'm trying to track down a problem I am having in Ansel, and I think
it's a larger issue with Datatree_sql::getByAttributes(). The problem
shows itself in Ansel when you set the 'group galleries by' option to
'none' and you display the gallery list by clicking on the galleries
icon in the menu. Depending on how many galleries you have, and how
many different owners, the galleries do not page correctly. I
sometimes get back more than the perpage value, and I see some of the
same galleries multiple times (although the counters displayed on the
page reflect what *should* be on the page).
To reproduce, I think you just need PERMS_SHOW to at least two gallery
owners (including yourself) and have more than perpage number of
galleries.
I believe I've tracked the problem down to
Datatree_sql::getByAttributes(). It looks like it performs a separate
query for each of the [OR] conditions, then puts all the results into
the $rows array that is returned. The problem is, if we are setting a
LIMIT, then we could be getting back more than the $count since *each*
query can return up to $count rows.
Am I on the right track here?
Thanks,
mike
--
The Horde Project (www.horde.org)
mrubinsk at horde.org
"Time just hates me. That's why it made me an adult." - Josh Joplin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-keys
Size: 2013 bytes
Desc: PGP Public Key
Url : http://lists.horde.org/archives/dev/attachments/20070621/b877b885/attachment.bin
More information about the dev
mailing list