Commit 6eac828b authored by renatog's avatar renatog Committed by renatog
Browse files

Issue #3271397 by RenatoG: Create a validation to full stop in the beginning...

Issue #3271397 by RenatoG: Create a validation to full stop in the beginning of class to avoid duplicated items in the JS
parent fd12a755
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -741,9 +741,19 @@ class BlockClassHelperService {

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

      return FALSE;
    }

    $classes = explode(' ', $classes);

    foreach ($classes as $class) {

      // Validate if the first char is a point and say that isn't necessary.
      if (strpos($class, '.') === 0) {
        $form_state->setErrorByName('class][third_party_settings][block_class][classes', $this->t("Isn't necessary add point in the beginning of class"));
        return FALSE;
      }
    }


  }