Using Require on Publish in combination with Conditional fields module

Created on 27 January 2022, over 2 years ago
Updated 20 January 2023, over 1 year ago

Problem/Motivation

I am currently using the contributed Conditional Fields → module in my site for a specific node type and wish to add Require on publish in addition to it. However when using both modules in combination, it appears that the require on publish constraint validator triggers errors for form fields that are hidden based on conditions satisified in the Conditional fields dependencies.

Steps to reproduce

  1. Install both the require on publish and conditional fields modules.
  2. Create two new fields on an existing content type making the second field Required on Publish.
  3. Navigate to 'Manage Dependencies' under Structure > Content Types > My Content type. Add a new dependency with the second field as Target field and the first as Control field with 'The target field is' Visible option 'when the control field' has value option.
  4. Create a content of the specified content type without a value for the first field in draft.
  5. Try to publish the Draft and this will trigger an error from the RequireOnPublishValidator stating the second field is required even when it is not visible in the form.

Proposed resolution

Please provide suggestions on how to get these two modules to be interoperable or how to update the constraint so that it is mindful of the form state instead of looping through all the available entity fields.

💬 Support request
Status

Active

Version

1.6

Component

Code

Created by

🇮🇳India optimusprime619

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.69.0 2024