Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). Varbase Media Header 9.2.1 Minor update available for module varbase_media_header (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

This module makes fields required only when an entity is in a specific workflow state. It is designed to improve the accuracy of complex, multi-person workflows.

The Workflow Required by State module allows fields to be required only when the associated entity (or parent entity) is in a specific workflow state.

N.B. This module extends the contrib Workflow module, and not core's content-moderation workflows.

USE CASES

The primary use case for this module is:

  • To make complex multi-participant workflows less error-prone.

REQUIREMENTS

This module requires the Workflow module.

INSTALLATION

Install as you would normally install a contributed Drupal module.
See: https://www.drupal.org/node/895232 for further information.

CONFIGURATION

You'll need the following before being able to configure this module's settings.

  • Add one or more workflows and populate them with some workflow states.
  • Add a content type and add a workflow field to it.
  • Add a field that you want to make dependent on the workflow state.

To configure this module's settings:

  • Open the settings of field that you want to make dependent on the workflow state.
  • Ensure that the "Required" checkbox is not checked.
  • Check the "Override the required flag per workflow state" checkbox.
  • Select the desired workflow from the "Select the workflow on which this field should depend" list.
  • Check the desired states from the "Select the workflow states that will make this field required" checkboxes.

The configuration checkbox labeled "Set field as required immediately upon selecting workflow state using Javascript." allows you to alter the behaviour of this module for a given field:

  • If you prefer to have the "required" state of the configured field take effect only after the form is submitted and the entity is in the desired state, leave this checkbox unchecked.
  • If you want the configured field to be flagged as required dynamically as soon as the Workflow state field value has changed, check this box, and Workflow Required by State will add some Javascript to the page to achieve this.

SIMILAR MODULES

  • Conditional Fields module should be able to achieve a similar behaviour if your entity form is simple and you want the "required" state of the desired field to take effect immediately.

Activity

Total releases
2
First release
Feb 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 2
Maintenance
Dormant

Releases

Version Type Release date
1.0.0-beta4 Pre-release Feb 7, 2025
1.0.0-beta3 Pre-release Feb 6, 2025