fix broken category search, selected cat=1 always, when only one category wasselected, as (int) of an array does not give the required/expected result

This commit is contained in:
Klaus Leithoff 2011-07-19 07:30:39 +00:00
parent 944a31e610
commit 39ccc98418

View File

@ -344,7 +344,7 @@ class calendar_so
{
$cats = $GLOBALS['egw']->categories->return_all_children($cat_id);
array_walk($cats,create_function('&$val,$key','$val = (int) $val;'));
if (is_array($cat_id) && count($cat_id)==1) $cat_id = $cat_id[0];
$sql = '(cal_category'.(count($cats) > 1 ? " IN ('".implode("','",$cats)."')" : '='.$this->db->quote((int)$cat_id));
foreach($cats as $cat)
{