Each wizard step lets you define a fooStep() form builder method on the wizard, but the system also expects a fooStepValidate() or it crashes:

  public function formValidate(&$form_state) {
    $validate_method = $this->currentStep->getFormMethod() . 'Validate';
    $this->{$validate_method}($form_state);
  }

It would be more in keeping with FormAPI (and so better DX) to make this optional, and check first whether the method exists. Not all steps require validation.

Comments

  • mikeryan committed 21a4e02 on 7.x-2.x
    Issue #2298969 by mikeryan: Verify wizard validation function exists
    
mikeryan’s picture

Status: Active » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

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

mikeryan’s picture

Issue tags: +Migrate 2.7