From f68e92afd82afdb9afa62169d15e3683d5a32d3d Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Fri, 14 Jan 2011 12:03:21 +0000 Subject: [PATCH] * addressbook: check if typefilter is valid (type available), if not remove it --- addressbook/inc/class.addressbook_ui.inc.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addressbook/inc/class.addressbook_ui.inc.php b/addressbook/inc/class.addressbook_ui.inc.php index 7a0a5dd1d2..2df01509a2 100644 --- a/addressbook/inc/class.addressbook_ui.inc.php +++ b/addressbook/inc/class.addressbook_ui.inc.php @@ -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) {