Including more than one 'modules' in $filter makes 'exclude' defunct

Excluded operations like 'delete' show up in the list if the code is like this :

$filters = array(
'module' => array('include' => array('nodeactivity', 'commentactivity')),
'type' => array('include' => array('acidfree', 'audio', 'blog', 'book' )),
'type' => array('exclude' => array('uprofile', 'usernode','story')),
'operation' => array('exclude' => array('delete', 'unpublish')), 

If the code states only one module in the array as shown below, 'exclude' works well and as expected

$filters = array(
'module' => array('include' => 'nodeactivity'), 
'type' => array('include' => array('acidfree', 'audio', 'blog', 'book' )),
'type' => array('exclude' => array('uprofile', 'usernode','story')),
'operation' => array('exclude' => array('delete', 'unpublish')), 

However, with this the comment activity is (obviously) no longer seen.

How to show both node activity and comment activity and yet keep operations like delete NOt show up in the list ? Some quickfix will be greatly appreciated !

Comments

jaydub’s picture

I'm going to commit a change to the filter stuff that should address a separate problem but in your case what you should be doing with your 'type' array is to make the 'include' and 'exclude' arrays both part of the single 'type' array.

So instead of:

  $filter = array(
    'module' => array(
      'include' => array('nodeactivity', 'commentactivity'),
    ),
    'type' => array(
      'include' => array('blog', 'story'),
    ),
    'type' => array)
      'exclude' => array('forum'),
    ),
    'operation' => array(
      'exclude' => array('delete', 'unpublish'),
    ),
  );

do

  $filter = array(
    'module' => array(
      'include' => array('nodeactivity', 'commentactivity'),
    ),
    'type' => array(
      'include' => array('blog', 'story'),
      'exclude' => array('forum'),
    ),
    'operation' => array(
      'exclude' => array('delete', 'unpublish'),
    ),
  );
sirkitree’s picture

Status: Active » Closed (fixed)