In edge-case scenarios, #validate and #submit may not be set on a $form.

If another module tries to prepend a form handler in hook_form_alter() using array_unshift() or the like, a PHP warning is thrown.

A potential example for this might be a form that solely uses button-level submit handlers.

Comments

dave reid’s picture

Could those be located inside the if (!sset()) conditions?

dave reid’s picture

Could those be located inside the if (!sset()) conditions?

sun’s picture

Issue tags: +Needs backport to D7
StatusFileSize
new932 bytes

Very good suggestion.

sun’s picture

#3: drupal.prepare-form-keys.3.patch queued for re-testing.

tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

Makes sense.
Although it's not really that hard a bite, I have been bitten by this before.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x and 7.x. Thanks!

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