Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMS allows user to delete a 'required' image and breaks build #4387

Closed
thissammarshall opened this issue Sep 29, 2020 · 2 comments
Closed

CMS allows user to delete a 'required' image and breaks build #4387

thissammarshall opened this issue Sep 29, 2020 · 2 comments
Labels
type: bug code to address defects in shipped code

Comments

@thissammarshall
Copy link

thissammarshall commented Sep 29, 2020

Describe the bug

I have created a CMS for a client with an image field that is required. If the client attempts to edit an existing CMS entry they are able to delete that required image and click update without the CMS warning that field is required.

To Reproduce

Add a list of images and mark field as required. Upload a CMS entry, edit the entry, delete the image, click update

Expected behavior

Expect that if a required image field is deleted and accidentally left empty then normal 'required' validation should be present

Screenshots

Applicable Versions:

  • Netlify CMS version: 2.12.16
  • Git provider: GitHub
  • OS: MacOS Catalina
  • Node.JS version: 11.15.0

CMS configuration

`backend:
name: git-gateway
branch: master

public_folder: static/images
media_folder: /images

display_url: https://blah.netlify.com/

collections:

  • name: "listingUpload"
    label: "Add/edit listing"
    folder: "src/data/listings"
    create: true
    extension: "json"
    format: "json"
    summary: "{{subNum}} {{streetNum}} {{streetName}} {{suburb}}"
    identifier_field: summary
    media_folder: ""
    public_folder: ""
    fields:
    ** inapplicable fields removed for brevity**
    • {
      label: "Images",
      name: "images",
      widget: "list",
      hint: "Important: At least one image is required",
      field: { label: "Image", name: "image", widget: "image" },
      }
      `

Additional context

@thissammarshall thissammarshall added the type: bug code to address defects in shipped code label Sep 29, 2020
@KoljaTM
Copy link
Contributor

KoljaTM commented Oct 4, 2020

I think this should be adressed by
maximum and minimum number of items in the list widget #1480
by setting the minimum number of images in the list

@martinjagodic
Copy link
Member

Closing as stale and/or outdated.

@martinjagodic martinjagodic closed this as not planned Won't fix, can't repro, duplicate, stale May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

3 participants