Persistent form filtering
chrisada - March 21, 2007 - 03:11
| Project: | Formfilter |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Description
I think the "Filter this form" feature has a lot of potential use, but user should be able to choose if the filtering is persistent, e.g. for a particular form. Also, it should be able to make the filtering applied as default to all users.

#1
+1 this makes sense to me.
#2
I don't fully understand the suggested changes. Can you explain more? What doesn't persist at present? What would persist?
I believe there is the ability to make the filtering apply to all users (except UID 1)--just don't give any users the permission to view forms without filtering.
#3
Apologies to you nedjo for sloppy testing on my part:
I hadn't realised that the form filter settings automatically 'save' themselves, and by default the filtered form is not shown to Admin (user/1)
... so I couldn't understand how to get the formfilters to stick ;P
Perhaps we could start work on a little light documentation ;)
#4
Point taken :) And, hey, anything you might want to post to that effect would be very welcome.
#5
How about this little description, which could be used on the project homepage (drupal.org/project/formfilter):
"
"
(Nb - the Preview link should (in a perfect world) disappear when no filters are active, ie if all the 'Hide ...' checkboxes are unselected.)
... I still find the 'Submit' method for the filter checkbox settings rather un-intuitive. For example, I'm testing it on a node-create form, which requires a node Title at least, so if I use the Preview or Submit buttons (without entering a title because I don't actually want to create a node), I get stalled and distracted by the formcheck error message. The filters get applied OK, but the UI/workflow becomes confusing.
Does that make sense ?
#6
@ #5.2 : Hang on ... even simpler solution:
Because the Form's Formfilter-edit page settings are applied when a checkbox is altered (we don't need to submit the changes), all we need to do is add the Preview a filtered version of this form link to the bottom of that page ... just to give Admins somewhere to go next ...?
#7
Thanks a lot for the suggested text, I've updated the module description.
Your other suggestions are good. I'll have to think a bit about how I could implement them, and I'm busy with other things, but if I find time I'll try to make improvements. Of course, if anyone wants to submit patches that would be great.
#8
@ #5 : add the Preview a filtered version of this form link to the bottom of the Form's Formfilter-edit page. This seems easy enough but unfortunately when the link is clicked, it doesn't 'save' the changes; getting the link to behave as a Submit button is apparently necessary :P ... I've been staring at this for hours and I just don't understand enough code to see how to do this ... ?
The attached patch simply reproduces the Preview link generator in the 'edit' bit of
function formfilter_form_alter. Part way there at least ;)