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.

Comments

mozz100’s picture

Patch attached for 7.x-2.x branch

sdrycroft’s picture

Status: Active » Fixed

I've just added this to the repository, and will make a release shortly. Thanks very much for the patch.

Simon

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.