On the HelpfulnessBlockForm validateForm() method:
$comment_required = $config->get('helpfulness_comment_required') ?? 0;
if (!$comment_required) {
$comment_text = strip_tags($form_state->getValue('helpfulness_comments'));
if (strlen($comment_text) < 1) {
$form_state->setErrorByName('helpfulness_comments', $config->get('helpfulness_comment_required_message'));
}
}
The "Comment required" configuration check when we submit the form is flipped. It's throwing the "This comment is required" error message when the comment is not required, and no message when it is required.
Simply taking off the negation is enough.
I'll create a new bugfix release out of it, as I feel it is impactful enough to be included ASAP.
Comments
Comment #3
gueguerreiroCommitted 3cbb6f8 and pushed to 2.x. Thanks!
I'll cherry pick it into the 8.x-1.x branch as well.
Comment #5
gueguerreiroCommitted 7569741 and pushed to 8.x-1.x. Thanks!