On HelpfulnessBlock's validateForm():

if (!form_state->getValue('helpfulness_rating')) {
      $form_state->setErrorByName('helpfulness_rating', $this->t('Please indicate if this page is helpful or not.'));
}

Since when the rating is "No" the value is 0, it would fall on the error condition when it shouldn't. We should be explicit and check for a NULL value here instead.

Comments

gueguerreiro created an issue. See original summary.

  • gueguerreiro committed 37f0652 on 2.x
    Issue #3168703 by gueguerreiro: Explicitly validate NULL values in the...

  • gueguerreiro committed 34e51fd on 8.x-1.x
    Issue #3168703 by gueguerreiro: Explicitly validate NULL values in the...
gueguerreiro’s picture

Assigned: gueguerreiro » Unassigned
Status: Active » Fixed

Committed 37f0652 and pushed to 2.x. Thanks!

Committed 34e51fd and pushed to 8.x-1.x. Thanks!

Status: Fixed » Closed (fixed)

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