Download & Extend

Views Flagged Filter Option for Any

Project:Flag
Version:6.x-2.x-dev
Component:Views integration
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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:

<?php
    $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.

Comments

#1

Component:Code» Views integration
Status:active» reviewed & tested by the community

needed same thing, attaching patch

AttachmentSize
flag_handler_filter_flagged.inc_.diff 1019 bytes

#2

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.

#3

Great, just what I needed! Thanks :-)

#4

Status:fixed» closed (fixed)

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