How to validate a config entity form? I have a config entity with a form which extends Drupal\Core\Entity\EntityForm, which has a public form() and a public save() methods. They both work fine and dandy. I want to validate some information before saving the form. As far as I can tell there's a validateForm() method already built in via the class it extends.

I can't seem to find much information on how to do that. I've tried the obvious, simply setting a return false in the validateForm method but it doesn't seem to be called at all.

I don't have much experience with Drupal in general so I'm obviously doing something wrong. 

If anybody could point me in the right direction here, I'd be grateful.

I'd also like to keep the field values in case of an error. I can only assume that that happens by default, but then again I may be wrong.
You can override the validateForm method in your own form class. Just declare a method like so:

public function validateForm(array &amp;$form, FormStateInterface $form_state) {
  // Your custom validation code.
}


Since the Drupal\Core\Form\FormBase (parent of Drupal\Core\Entity\EntityForm) class has no validation, just a blank method, there is no need to call the parent method from your own class.