13-15 March 2020

City, University London

Decoupling Entity-validations from Entity-forms


Knowledge about the following topics will help you better understand the session:

  • Form API
  • Custom Module Development
Session details

Entities are an integral part of the Drupal ecosystem and almost every entity in Drupal is linked with forms. Thus Drupal provides a beautiful Form API that helps in building, validating and submission of forms. All three stages are very important and have their own significance. But our focus throughout the session will be the form validation aspect.


To perform custom server-side validations on forms we often write #validate functions in Drupal which always do the job. But there are some negatives to it, Example: Validations don’t run when you try creating/editing the entity via means other than entity form. Perhaps this problem was assessed and tackled in Drupal 8 by the introduction of Entity validation constraints.


In this session we will be learning about the following:

  • Problem with form API validation

  • Creating custom validation constraint

  • Applying validation constraint to the entity field

  • Applying validation constraint to the entity

  • Running validations for REST API requests

  • The Demo


At the end of this session, users will have a clear understanding of how decoupling entity validation from entity forms allows validations to be independent of form submissions.

Skill Level
Session Track
Scheduled day
Session Time
12.05 - 12.50





Acquia - Experience digital freedom
Agiledrop - Trusted Drupal teammates

Weekend Keynote Speakers

Kevin Bridges


Michel van Velde

One Shoe, CEO

Nick Veenhof

Dropsolid, CTO

CxO Keynote Speakers

Kevin Bridges


Michel van Velde

One Shoe, CEO

Greg Harvey

Code Enigma, Director

Rachel Lawson

Drupal Association, Community Liaison

Carrie Lacina

Drupal Association, Fund Development Director

Jeffrey A. “jam” McGuire

Open Strategy Partners, Partner

Tracy Evans

Open Strategy Partners, Partner

Join the Drupal Association

The Drupal Association unites a global open source community to build and promote Drupal.

The Association is a not-for-profit organization that relies on individuals and businesses to fund everything they do for Drupal — from drupal.org to DrupalCon and community programs.

Connect with us and support our mission-driven work.

Support the Drupal Association

Hosting provided by