Hello! I am creating an exposed filter by using states from the "Workflow" module. Specifically, I have two workflows, with a bunch of states in each. Only one of the two is associated with the node type I am manipulating in my view.

In order to create a filter that only contains the states that are relevant to my node type, I use "Limit list to selected items" and select only the states of the one workflow I need.

In the resulting popup menu of the exposed filter, however, an additional empty optgroup is generated for the other unwanted workflow, despite the fact that nothing was selected in there. The select looks like:

<select ..> <option ..>Any</option> <optgroup label="good states">
<option>one</option><option>two</option> <option>three</option>
</optgroup> <optgroup label="unwanted"></optgroup></select>

The second optgroup shouldn't be there; it also cannot be hidden in IE, as it doesn't implement "display:none" correctly on optgroup elements.

Thanks!

Comments

uprojects’s picture

i have the same problem :(

dawehner’s picture

Project: Views (for Drupal 7) » Workflow
Version: 6.x-2.5 » 6.x-1.x-dev
Component: exposed filters » Code

This is a bug by workflow.

it works fine for a normal module.

freakalis’s picture

StatusFileSize
new1.58 KB

Here is a patch that solves this issue and removes optgroups with no values in them

freakalis’s picture

Status: Active » Needs review

Forgot to change status

Shadlington’s picture

Patch failed to apply on 1.5 for some reason so I went ahead and did it manually. Works perfectly!

Bastlynn’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev

I would love to see a version of this rolled for D7 to be backported to D6.

Bastlynn’s picture

Status: Needs review » Closed (duplicate)

This is a duplicate of #658880: Add selection for 'creation' state and workflow type in "Workflow: current state " filter and that ticket has a patch in consideration, I'm going to close this issue out, work will continue on the other ticket.