[ansel] gallery ordering issue

Chuck Hagenbuch chuck at horde.org
Thu Apr 8 19:28:16 PDT 2004


Quoting Ben Chavet <ben at chavet.net>:

> [ansel] SQL Query by DataTree_sql::_loadById(): SELECT datatree_id,
> datatree_name, datatree_parents, datatree_order FROM horde_datatree WHERE
> (datatree_id IN (2841) OR datatree_parents = ':2841') AND group_uid =
> 'horde.shares.ansel' ORDER BY datatree_id [on line 242 of
> "/home/ben/pear/Horde/DataTree/sql.php"]
>
> This definitely grabs the children of the gallery.  Horde might not use them,
> but they are returned by the sql server. This is one of the 6 database calls
> resulting from:

Yup, sure looks that way. Here's the section of code:

             /* Load the parents of each of these. */
             $pquery .= ' OR datatree_parents = ' . $this->_db->quote($parent .
':' . $cid);

             /* If this is a non-top-level object, load siblings too. */
             if (!empty($parent)) {
                 /* Strip off the beginning ':', explode and add to the mix. */
                 $pids = array_merge($pids, explode(':', substr($parent, 1)));
             }

.. so, as may or may not be apparent from the comments, I don't think that's
intended. Would anyone like to volunteer to experiment (not just in Ansel, but
in places like the permissions admin and in Giapeto) with always setting
$pquery to ''? You could also take out the bit that loads siblings and see
where that gets you.

(Yes, I should probably do this myself, but I'm moving on Monday, so I'm a tad
scattered and rather busy right now. I've love some help. :)


-chuck

--
"Regard my poor demoralized mule!" - Juan Valdez


More information about the ansel mailing list