Skip to content
This repository has been archived by the owner on Dec 13, 2021. It is now read-only.

Empty media picker is able to be saved and published when set as mandatory. #16

Closed
SH00KS opened this issue May 11, 2017 · 2 comments
Closed
Labels

Comments

@SH00KS
Copy link

SH00KS commented May 11, 2017

Summary of situation

When I've added a mandatory media picker property to a document used in Stacked Content the validation seems to fail and allows me to save and publish the parent document even when a media item hasn't been set. Putting a mandatory media picker on the parent document type doesn't have the same issue only within Stacked Content.

Enviroment details

OS: Windows 7
Browsers:
Google Chrome
Firefox
Internet Explorer 11

How to reproduce

To isolate and test the issue outside of my project I did the following:

  1. Created a fresh install of Umbraco 7.5.8 via Nuget
  2. Installed Stacked Content via Nuget (version 1.04)
  3. Created new document type consisting of only a mandatory media picker called "File Download Test".
  4. Created a "Test" page under a blank home node of document type "File Download Test".
  5. Attempted to publish the page without choosing a media item. - As expected Umbraco would not let me save and flagged the usual validation messages.
  6. Created a new Stacked Content data type and added "File Download Test" as document type within the stacked content.
  7. Created a new document type "File Download Stacked Content Test" and added the Stacked Content data type, checked the "Field is mandatory" box leaving the default "Validation" in the drop down box.
  8. Created a "Test Stacked Content" page under the same home node of document type "File Download Stacked Content Test".
  9. Gave the page a name and added the first Stacked Content item, did not select anything for "File Download Test" media picker and clicked submit. Stacked content allowed me to submit and presented the first item in the row. - At this point I would expect to see validation messages.
  10. Clicked save and publish at the page level and this allowed me to successfully save and publish again without any validation errors.

Thoughts

Couple of observations:

  1. Ideally it would be good if stacked content could be validated when it was submitted, however I understand that this may not be possible due to the validation most likely occurring server side.
  2. Validation should at least occur during the main page save and the invalid stacked content entry highlighted.
  3. I suspect that no validation is actually occurring for the Stacked Content type, however I'm unsure how to test this theory.
@leekelleher
Copy link
Contributor

@SH00KS Firstly, thanks for the well thought out bug report, it's very much appreciated and refreshing!

I don't think we're doing any validation, for the same reasons you mention - @mattbrailsford is that correct?

@leekelleher
Copy link
Contributor

I'm going to close this ticket off. This is still very much an important feature request - which I've opened over on the InnerContent repository: umco/umbraco-inner-content#21

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants