Save with required fields

Created on 25 May 2023, over 1 year ago
Updated 19 July 2024, 4 months ago

Problem/Motivation

Would like to be able to save the node even if there are empty required fields.

Steps to reproduce

Add new field and set it as required, try save & edit the node.

Proposed resolution

Add a new checkbox on settings to enable bypass required fields.
Implement new form validation to clear errors.

✨ Feature request
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom lexsoft London

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

Comments & Activities

  • Issue created by @lexsoft
  • @lexsoft opened merge request.
  • Status changed to Needs review over 1 year ago
  • πŸ‡¬πŸ‡§United Kingdom lexsoft London
  • @lexsoft, I tried the MR2 on 9.5.8, and I can see the bypass required field. But still when I try to save a node without filling the required field, still can't save. See the screenshots for reference

  • πŸ‡¬πŸ‡§United Kingdom lexsoft London

    Hi @Tanuja,

    What you are seeing is client side validation.
    You probably need to add this module: https://www.drupal.org/project/disable_html5_validation β†’ or add novalidate attribute to the node form.

  • Status changed to Needs work over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States caesius

    MR no longer applies to latest dev.

  • πŸ‡ΊπŸ‡ΈUnited States jcandan

    I wonder if this module will play well with others. Take a look at Require on Publish β†’ .

  • πŸ‡ΊπŸ‡ΈUnited States caesius

    Another possibility if the intent is to simply save work in progress is Autosave Form β†’ .

    I don't think the Save & Edit module should itself support bypassing required fields, since even though the intent of this module is to facilitate drafting content, there's currently no mechanism to prevent Save & Edit from appearing on published content.

    However, I would support adding this functionality providing the following conditions are met.

    • Add a configuration option to enable saving content without filling in required fields (except the title/label).
    • Add a completely independent configuration option to not allow Save & Edit for Published to Published workflows generally.
    • Add a configuration option that is dependent upon the above two options whereby if the former is enabled and the latter is not, disable the ability to Save & Edit from Published to Published if any required fields are not filled in.

    Obviously this is fairly complicated so it's probably more efficient to just rely on a secondary module to get "close enough."

Production build 0.71.5 2024