fix for invalid category ids, eg. delete categories

This commit is contained in:
Ralf Becker 2009-07-16 16:05:40 +00:00
parent 2cfa5530c3
commit a5ff2eb037
2 changed files with 3 additions and 4 deletions

View File

@ -1468,9 +1468,9 @@ class addressbook_bo extends addressbook_so
$cat_list = array(); $cat_list = array();
foreach($cat_id_list as $cat_id) foreach($cat_id_list as $cat_id)
{ {
if ($cat_data = $this->categories->return_single($cat_id)) if ($cat_id && ($cat_name = $this->categories->id2name($cat_id)) && $cat_name != '--')
{ {
$cat_list[] = $cat_data[0]['name']; $cat_list[] = $cat_name;
} }
} }

View File

@ -231,9 +231,8 @@ class addressbook_vcal extends addressbook_bo
break; break;
case 'cat_id': case 'cat_id':
if (!empty($value)) if (!empty($value) && ($values = $this->get_categories($value)))
{ {
$values = &$this->get_categories($value);
$values = (array) $GLOBALS['egw']->translation->convert($values, $sysCharSet, $_charset); $values = (array) $GLOBALS['egw']->translation->convert($values, $sysCharSet, $_charset);
$value = implode(',', $values); // just for the CHARSET recognition $value = implode(',', $values); // just for the CHARSET recognition
if(($extra_charset_attribute || $this->productName == 'kde') if(($extra_charset_attribute || $this->productName == 'kde')