This project is not covered by Drupal’s security advisory policy.

Overview

This community project exists to coordinate the Field Required Context Initiative, an effort to introduce a shared, context-aware model of field requiredness to Drupal core and contrib modules. It is not a module or theme and does not provide code for use on production sites. Instead, it serves as a home for documentation, planning, and meta-issues related to the initiative.

Problem

Today, Drupal treats “required” as a static field-level property, while real sites need fields that are required only in certain contexts, for example:

  • Required when publishing, but optional when saving a draft (HTML5 attribute blocks submit for Required on Publish).
  • Required only when a composite field is “minimally required” (for example, Name and Address subcomponents).
  • Required only when workflow transitions, business rules, or import operations say so.

Many contrib projects (Require on Publish, Name, Address, Conditional Fields, Webform, Paragraphs, Migrate, Feeds, and others) implement their own ad-hoc logic for this, leading to duplicated work and inconsistent behavior.

Goal

The initiative’s goal is to explore and propose a unified approach to context-aware requiredness in Drupal, including:

  • A shared concept of a validation “context” (operation, workflow state, import vs UI, composite activation, etc.).
  • An API service to answer “is this field required in this context?” for core and contrib.
  • Guidance and patterns for complex fields (such as Name and Address) to express their own internal “minimum completeness” rules using that API.
  • Integration patterns for modules such as Require on Publish, Conditional Fields, Webform, Migrate, Feeds, Paragraphs, and others.

Scope of this project

This project will:

  • Act as a central coordination point for the Field Required Context Initiative.
  • Host issue queues for planning, research, and tracking related core and contrib work.
  • Provide documentation, architecture notes, and references to example implementations (for example, a contrib proof-of-concept module such as “field_required_context”).

It will not:

  • Ship a supported module or theme for site builders.
  • Replace existing contrib projects that already provide field-level validation logic.

Who should get involved

This initiative is relevant to:

  • Core and contrib maintainers working with Field API, Entity/Typed Data, Validation, Workflow, and Form API.
  • Maintainers of modules that implement their own contextual requiredness (Require on Publish, Name, Address, Conditional Fields, Webform, Paragraphs, Migrate, Feeds, and similar projects).
  • Architects and site builders who run complex editorial workflows and want predictable, context-aware validation behavior.

How to participate

Contributors are encouraged to:

  • Join discussions on the issue queue and in related BoFs and meetings.
  • Help catalogue current patterns used by core and contrib for contextual required fields.
  • Review and refine proposed APIs and proof-of-concept implementations.
  • Test integrations of a shared “field required context” service in real modules and site builds.

Project information

  • Created by jcandan on , updated
  • shield alertThis project is not covered by the security advisory policy.
    Use at your own risk! It may have publicly disclosed vulnerabilities.

Releases