diff --git a/include/class.filter.php b/include/class.filter.php index 7178aece5eba1d0540020b9898f2602bdcdd55df..3889c770eac0c4d44f5676d7ce360cd6bb9e0708 100644 --- a/include/class.filter.php +++ b/include/class.filter.php @@ -473,18 +473,22 @@ class Filter { function save($id,$vars,&$errors) { if ($this) { foreach ($this->getActions() as $A) { - if ($A->type == 'dept') - $dept = Dept::lookup($A->parseConfiguration($vars)['dept_id']); - - if ($A->type == 'topic') - $topic = Topic::lookup($A->parseConfiguration($vars)['topic_id']); + if ($A->type == 'dept') { + $dept = Dept::lookup($A->parseConfiguration($vars)['dept_id']); + $dept_action = $A->getId(); + } + + if ($A->type == 'topic') { + $topic = Topic::lookup($A->parseConfiguration($vars)['topic_id']); + $topic_action = $A->getId(); + } } } - if($dept && !$dept->isActive()) + if($dept && !$dept->isActive() && !in_array('D' . $dept_action,$vars['actions'])) $errors['err'] = sprintf(__('%s selected for %s must be active'), __('Department'), __('Filter Action')); - if($topic && !$topic->isActive()) + if($topic && !$topic->isActive() && !in_array('D' . $topic_action,$vars['actions'])) $errors['err'] = sprintf(__('%s selected for %s must be active'), __('Help Topic'), __('Filter Action')); if(!$vars['execorder']) diff --git a/include/staff/filter.inc.php b/include/staff/filter.inc.php index ba0c06ce58ccdd35b8dadcdc9001362477da7b83..100e1273cb9def31eef2bc386705526e5fddb117 100644 --- a/include/staff/filter.inc.php +++ b/include/staff/filter.inc.php @@ -242,7 +242,6 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); $existing[] = $A->type; if($A->type == 'dept') { $errors['topic_id'] = ''; - // $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); $dept_config = $A->parseConfiguration($_POST); $dept = Dept::lookup($dept_config['dept_id']); if($dept && !$dept->isActive())