Testing the module, filtered a bunch of things, hit Preview, worked fine, 'Form Filtering registered.' message. However it's kind of misleading because you don't see the previewed version until you hit 'Preview a filtered version of this form' (after you've already hit the Preview button the first time). But this is minor. Possibly should say 'Filter' the first time.

Another suggestion, on a form with filtering previously applied, 'Filter this form' could be changed to something like 'Modify this form' so you it's easy to tell which forms you've changed. Still minor. Very useful module.

The error i came up with here was when i used this on a cck content type i called 'Packages' and unchecked the filtering via clicking the 'Filter this form' link again and got the warning 'warning: array_filter() [function.array-filter]: The first argument should be an array in ....sites/all/modules/formfilter/formfilter.module on line 140.' But it still worked and also got the Form filtering registered message below.

The filters i applied were Hide Input format: , Hide contact: , Hide Log message: , Hide Menu settings: , Hide Authoring information: , and Hide Publishing options: . The only one that was from a non-core module was the 'contact' box, from cck email module.

Thanks again, and nice work.

CommentFileSizeAuthor
#8 formfilter.197129.patch238 bytesalberto56

Comments

zmove’s picture

Same problem here

reproduce condition :

Create a node type, set a fieldset as hidden validate. All is ok, the fieldset is hidden.

Edit again form filters to make the fieldset visible again, validate :

warning: array_filter() [function.array-filter]: The first argument should be an array in.../www/drupal5/sites/all/modules/formfilter/formfilter.module on line 140.
joeBro’s picture

subscribe

joeBro’s picture

As kind of a quick fix for this you can add this to formfilter.module after line 86: $form_filters = array();
Add:

if (!is_array($filters[$form_id])){
  $filters[$form_id] = array();
}

It simply initializes $filters[$form_id] as an array...

pfaocle’s picture

Hit a similar error when using formfilter in conjunction with a custom, multi-step form. The quick fix in #3 seems to eliminate the warning. Testing on a dev site, no apparent side-effects so far...

Grimlock’s picture

Thanks for the fix JoBro!

thedosmann’s picture

subscribe

nedjo’s picture

Status: Active » Closed (duplicate)
alberto56’s picture

StatusFileSize
new238 bytes

Here is the patch of #3 as a patch file.