Skip to content
Snippets Groups Projects
Commit 6dc860db authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2406113 by fago: Clarify how ContentEntityForm::validate() should be overridden

parent 3e43de76
No related branches found
No related tags found
No related merge requests found
......@@ -58,6 +58,15 @@ public function form(array $form, FormStateInterface $form_state) {
/**
* {@inheritdoc}
*
* Note that extending classes should not override this method to add entity
* validation logic, but define further validation constraints using the
* entity validation API and/or provide a new validation constraint if
* necessary. This is the only way to ensure that the validation logic
* is correctly applied independently of form submissions; e.g., for REST
* requests.
* For more information about entity validation, see
* https://www.drupal.org/node/2015613.
*/
public function validate(array $form, FormStateInterface $form_state) {
$entity = $this->buildEntity($form, $form_state);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment