Updated: Comment #N

Problem/Motivation

While working on #576276: Abort validation when the token validation fails, I attempted to use #token => FALSE, but it resulted in Undefined index: form_token

Proposed resolution

Remaining tasks

User interface changes

API changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tim.plunkett’s picture

Title: Submitting a form as an anonymous user when $form['token'] = FALSE results in an error » Submitting a form as an anonymous user when $form['#token'] = FALSE results in a notice
larowlan’s picture

Status: Active » Needs review
FileSize
2.07 KB

this passes locally, not seeing the same warnings as previous issue.

tim.plunkett’s picture

Unless you're running the simpletests as an anonymous user, it won't fail.

Status: Needs review » Needs work

The last submitted patch, 2: form-token-2143349.1.patch, failed testing.

larowlan’s picture

Status: Needs work » Needs review
FileSize
821 bytes
2.87 KB

perhaps this then, also we mustn't have test coverage for that functionality either

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, that works perfectly, and seems as good a place as any to unset it.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

The before/after code here is definitely cleaner. Rock! I was a bit concerned about the ability to set #token to FALSE, but this logic already exists in FormBuilder::prepareForm and is simply copied here as well.

Committed and pushed to 8.x. Thanks!

amateescu’s picture

Edit: sorry, wrong issue :/

Status: Fixed » Closed (fixed)

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