Change record status: 
Project: 
Introduced in branch: 
8.x
Description: 

In previous versions of Drupal, when calling form_set_error() and form_error():

  • During validation would prevent submission, mark the offending element, and use drupal_set_message() to display an error message.
  • During submission would only use drupal_set_message() to display an error message, and the element would not be marked in any way.

In Drupal 8, calling form_set_error() and form_error() (now FormStateInterface::setErrorByName() and FormStateInterface::setError(), respectively) will only have an effect during validation.
Calling them during submission will do nothing. Those instances should be replaced by a drupal_set_message() call directly.

Impacts: 
Module developers