* addressbook: check if typefilter is valid (type available), if not remove it

This commit is contained in:
Klaus Leithoff 2011-01-14 12:03:21 +00:00
parent 11db1a8224
commit f68e92afd8

View File

@ -336,6 +336,11 @@ class addressbook_ui extends addressbook_bo
// be a bit more sophisticated asbout it
$content['nm']['header_right'] = 'addressbook.index.right_add';
$availabletypes = array_keys($this->content_types);
if ($content['nm']['col_filter']['tid'] && !in_array($content['nm']['col_filter']['tid'],$availabletypes))
{
//_debug_array(array('Typefilter:'=> $content['nm']['col_filter']['tid'],'Available Types:'=>$availabletypes,'action:'=>'remove invalid filter'));
unset($content['nm']['col_filter']['tid']);
}
if (!isset($content['nm']['col_filter']['tid'])) $content['nm']['col_filter']['tid'] = $availabletypes[0];
if (count($this->content_types) > 1)
{