Commit b1f0a079 authored by renatog's avatar renatog Committed by renatog
Browse files

Issue #3270550 by RenatoG: Form set error by name isn't highlighting the field correctly

parent 9ce0331f
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -408,7 +408,7 @@ class BlockClassHelperService {

        if (preg_match('/[\'^£$%&*()}{@#~?><>,|=+¬]/', $classes)) {

          $form_state->setErrorByName('third_party_settings[block_class][classes]', $this->t("In class is allowed only letters, numbers, hyphen and underline"));
          $form_state->setErrorByName('third_party_settings][block_class][classes', $this->t("In class is allowed only letters, numbers, hyphen and underline"));

          return FALSE;

@@ -432,7 +432,7 @@ class BlockClassHelperService {

    if ($pipe_found === FALSE) {

      $form_state->setErrorByName('third_party_settings[block_class][attributes]', $this->t("You need to insert a pipe on attributes field"));
      $form_state->setErrorByName('third_party_settings][block_class][attributes', $this->t("You need to insert a pipe on attributes field"));

      return FALSE;

@@ -441,7 +441,7 @@ class BlockClassHelperService {
    // Prevent attribute id.
    if (str_contains($attributes, 'id|')) {

      $form_state->setErrorByName('third_party_settings[block_class][attributes]', $this->t("You can't the attribute id"));
      $form_state->setErrorByName('third_party_settings][block_class][attributes', $this->t("You can't the attribute id"));

      return FALSE;

@@ -450,7 +450,7 @@ class BlockClassHelperService {
    // Prevent attribute class.
    if (str_contains($attributes, 'class|')) {

      $form_state->setErrorByName('third_party_settings[block_class][attributes]', $this->t("You can't use class. Use the field class instead"));
      $form_state->setErrorByName('third_party_settings][block_class][attributes', $this->t("You can't use class. Use the field class instead"));

      return FALSE;

@@ -467,7 +467,7 @@ class BlockClassHelperService {

      if (!str_contains($attribute, '|')) {

        $form_state->setErrorByName('third_party_settings[block_class][attributes]', $this->t("You need to insert a pipe on attributes field"));
        $form_state->setErrorByName('third_party_settings][block_class][attributes', $this->t("You need to insert a pipe on attributes field"));

        return FALSE;