I wanted to create a view with an exposed filter where a user can choose the state of a flag (Flag or unflag). However I wanted it to be optional so by default it would show all nodes regardless of flag state. Right now it will always default to either flagged or not flagged.

I don't have flag cvs checked out right now but in includes/flag_handler_filter_flagged.inc:

    $form['value']['#options'] = array(1 => t('Flagged'), 0 => t('Not flagged'), 'All' => t('All'));

Adding the 'All' value to the options form corresponds with the option that has '' as the label in views.

CommentFileSizeAuthor
#1 flag_handler_filter_flagged.inc_.diff1019 bytesmarcoBauli

Comments

marcoBauli’s picture

Component: Code » Views integration
Status: Active » Reviewed & tested by the community
StatusFileSize
new1019 bytes

needed same thing, attaching patch

quicksketch’s picture

Version: 6.x-1.1 » 6.x-2.x-dev
Status: Reviewed & tested by the community » Fixed

The interaction when using the "All" option is a little bit strange, but Views handles all the validation for us in an acceptable way. I committed to the 2.x branch.

tomsm’s picture

Great, just what I needed! Thanks :-)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.