* GroupDAV/CardDAV: fixed empty addressbooks issue (url in PROPFIND contained empty id --> "/.vcf" instead "/123.vcf")

caused by not longer necessary special handling of contact_id in addressbook_sql, which is handled now in so_sql(_cf)
This commit is contained in:
Ralf Becker 2011-03-23 09:21:45 +00:00
parent 28fe53bfa1
commit 78d8879041
2 changed files with 4 additions and 17 deletions

View File

@ -560,8 +560,8 @@ class addressbook_so
*/
function &search($criteria,$only_keys=True,$order_by='',$extra_cols='',$wildcard='',$empty=False,$op='AND',$start=false,$filter=null,$join='')
{
//echo "<p>socontacts::search(".print_r($criteria,true).",'$only_keys','$order_by','$extra_cols','$wildcard','$empty','$op','$start',".print_r($filter,true).",'$join')</p>\n";
//error_log("socontacts::search(".print_r($criteria,true).",'$only_keys','$order_by','$extra_cols','$wildcard','$empty','$op','$start',".print_r($filter,true).",'$join')");
//echo '<p>'.__METHOD__.'('.array2string($criteria,true).','.array2string($only_keys).",'$order_by','$extra_cols','$wildcard','$empty','$op',$start,".array2string($filter,true).",'$join')</p>\n";
//error_log(__METHOD__.'('.array2string($criteria,true).','.array2string($only_keys).",'$order_by','$extra_cols','$wildcard','$empty','$op',$start,".array2string($filter,true).",'$join')");
// the nextmatch custom-filter-header country-select returns a 2 letter country-code
if (isset($filter['adr_one_countryname']) && strlen($filter['adr_one_countryname']) == 2)

View File

@ -248,7 +248,8 @@ class addressbook_sql extends so_sql_cf
*/
function &search($criteria,$only_keys=True,$order_by='',$extra_cols='',$wildcard='',$empty=False,$op='AND',$start=false,$filter=null,$join='',$need_full_no_count=false)
{
if ((int) $this->debug >= 4) echo "<p>socontacts_sql::search(".print_r($criteria,true).",".print_r($only_keys,true).",'$order_by','$extra_cols','$wildcard','$empty','$op','$start',".print_r($filter,true).",'$join')</p>\n";
if ((int) $this->debug >= 4) echo '<p>'.__METHOD__.'('.array2string($criteria,true).','.array2string($only_keys).",'$order_by','$extra_cols','$wildcard','$empty','$op',$start,".array2string($filter,true).",'$join')</p>\n";
//error_log(__METHOD__.'('.array2string($criteria,true).','.array2string($only_keys).",'$order_by','$extra_cols','$wildcard','$empty','$op',$start,".array2string($filter,true).",'$join')");
$owner = isset($filter['owner']) ? $filter['owner'] : (isset($criteria['owner']) ? $criteria['owner'] : null);
@ -345,20 +346,6 @@ class addressbook_sql extends so_sql_cf
case 'string':
$only_keys = explode(',',$only_keys);
// fall through
case 'array':
foreach($only_keys as $key => $val)
{
switch($val)
{
case 'id': case 'contact_id':
$only_keys[$key] = $this->table_name.'.contact_id';
break;
case 'owner': case 'contact_owner':
$only_keys[$key] = $this->table_name.'.contact_owner';
break;
}
}
break;
}
// postgres requires that expressions in order by appear in the columns of a distinct select
if ($this->db->Type != 'mysql' && preg_match("/([a-zA-Z_.]+)<>''/",$order_by,$matches))