[dev] getShareCriteria() problem

Ben Chavet ben at chavet.net
Sun Oct 31 20:35:49 PST 2004


Ok, I'm stumped.  When you send an $owner to getShareCriteria(), it will always
return 0 results, whether you are authenticated or a guest.  a var_dump of
$criteria and SQL query are listed below.  $criteria looks good to me and I've
done as much probing as I can, but these queries are way over me.

array(1) {
  ["AND"]=>
  array(2) {
    [0]=>
    array(3) {
      ["field"]=>
      string(4) "name"
      ["op"]=>
      string(1) "="
      ["test"]=>
      string(10) "perm_guest"
    }
    [1]=>
    array(3) {
      ["field"]=>
      string(5) "value"
      ["op"]=>
      string(1) "&"
      ["test"]=>
      int(2)
    }
  }
}

array(1) {
  ["AND"]=>
  array(2) {
    [0]=>
    array(3) {
      ["field"]=>
      string(4) "name"
      ["op"]=>
      string(1) "="
      ["test"]=>
      string(10) "perm_guest"
    }
    [1]=>
    array(3) {
      ["field"]=>
      string(5) "value"
      ["op"]=>
      string(1) "&"
      ["test"]=>
      int(2)
    }
  }
}


SELECT COUNT(DISTIN
CT c.datatree_id) FROM horde_datatree c LEFT JOIN horde_datatree_attributes a1
ON a1.datatree_id = c.datatree_id WHERE c.group_uid = 'horde.sh
ares.ansel' AND ((a1.attribute_name = 'perm_guest' AND CASE WHEN
CAST(a1.attribute_value AS VARCHAR) ~ '^-?[0-9]+$' THEN (CAST(a1.attribute_va
lue AS INTEGER) & 2) <> 0 ELSE FALSE END) AND (a1.attribute_name = 'owner' AND
a1.attribute_value = 'ben')) AND datatree_parents = '' AND a1.a
ttribute_name = a1.attribute_name


More information about the dev mailing list