Option field in Views filters is unused

gnassar - December 1, 2007 - 21:24
Project:Forward
Version:HEAD
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

The option field in the forward_count and clickthrough_count Forward Views filters is thrown away by the filter code, as option fields have to be handled in a custom handler and both of those use the default handler.

If there is a purpose for the option field (which effectively makes a second input field), a custom handler should be written (and the purpose should be specified in the filter text). But it would seem like the only purpose is as the filter value itself; this is reinforced by the fact that the 'value' array key (a required field as per the API) is missing.

Patch enclosed. It is based on the above assumption, and specifies 'value'->'integer', and removes the option fields. If instead there was a purpose for having two input fields (the required value field as well as the option field), that should be added to the filter text and a custom handler should be created for it instead of using this patch.

AttachmentSize
forward.module.HEAD_.filtervalue.r0.patch951 bytes

#1

gnassar - December 1, 2007 - 21:27
Status:active» needs review

Boy, I'm on a cold streak. That's twice in a row I forget to mark as patch enclosed.

#2

gnassar - May 28, 2008 - 05:36
Version:5.x-1.x-dev» HEAD

Re-rolled against current HEAD.

It's a simple patch. Been running with it for months.

AttachmentSize
forward.module.HEAD_.filtervalue.r1.patch 953 bytes
 
 

Drupal is a registered trademark of Dries Buytaert.