Problem/Motivation
After installing hashcash module, I notice that forms on my site appear differently. Disabling hashcash reverts them to their original state. Using "inspect element" I discover that attributes from my form tags have been discarded. Importantly, "class" has disappeared.
Proposed resolution
In hashcash_form_alter, instead of setting form['#attributes'], which overwrites the entire contents of form['#attributes'], set $form['#attributes']['onsubmit']
Remaining tasks
I will attach a patch; please review my code; I'm not a PHP expert, or a Drupal expert. I'm not sure of the full ramifications, but this seems to fix it for me.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | retain-form-attributes-issue-number-1960596.patch | 605 bytes | mozz100 |
Comments
Comment #1
mozz100 commentedPatch attached for 7.x-2.x branch
Comment #2
sdrycroft commentedI've just added this to the repository, and will make a release shortly. Thanks very much for the patch.
Simon