Looks like when filtering a form with CCK Filefields the Attach button does not disappear when hiding the filefield from the form. In this case the filefield is in a fieldgroup and both the fieldgroup and filefield are hidden. The input type of submit does not hide with the field so there is a random attach button sitting out there. I haven't tested it but i think adding a case for "submit" to the _formfilter_filter_element function with some code will fix it.
function _formfilter_filter_element(&$element, $recurse = TRUE) {
I can work on this more later and submit a patch but wanted to see if anyone else has noticed this or has ideas for fixes.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | formfilter-attach-button.patch | 628 bytes | jkopel |
Comments
Comment #1
Summitt Dweller commentedI have no idea how to fix this but can confirm, I believe, seeing it. In my case I've told FormFilter to hide the "File Attachments" group and it does this but leaves the "Attach" button from that group visible.
FYI: In case it's not clear what I'm referring to here... the very same File Attachments control appears on this page near the bottom, just above "Tags".
Comment #2
nedjoI'd welcome a patch.
Comment #3
jkopel commentedThe attach button is a submit instead of a button (input type="submit" class="form-submit ahah-processed" value="Attach" id="edit-attach" name="attach").
adding 'submit' to the list of filtered form element types seems to fix the problem (although I am still testing for side effects).
My patch technique is lousy but here is an attempted fix.
Comment #4
jkopel commentedOK, I see that you had intentionally not included support for submit buttons, but this does represent a problem.
Are you willing to allow the submit/preview/delete button to be hidden, or, does there need to be a way to loop through the submits separately and see if one (i.e. attach) should be hidden?
Comment #5
peterparker commentedsubscribe
And to add my desires to the list I would love to get rid of this rogue attach button as it greatly confuses some people.