Skip to content
This repository has been archived by the owner on Mar 7, 2019. It is now read-only.

Cannot Save (without publishing) when archetype contains errors #151

Closed
abriggs-eduserv opened this issue Jun 20, 2014 · 10 comments
Closed

Comments

@abriggs-eduserv
Copy link

Hi,

Archetype appears to be preventing Umbraco from saving changes when a field in the archetype has failed validation.

E.g. you cannot save a work-in-progress page unless you complete all the mandatory fields within an archetype.

The behavior is the same if it's built-in validation (required field) or property editor specific validation (e.g. max nodes in a MNTP)

I'm on Umbraco 7.1.4 with Archetype v1.2.1-beta.

Thanks,

@kgiszewski
Copy link
Owner

Are you wanting the Archetype to save if invalid? Just not publish? I'm not sure that will be possible.

@kjac
Copy link
Contributor

kjac commented Jun 20, 2014

At the moment all validation is performed client side. That does have the
implication that you can't save an invalid draft of an archetype.
At the moment there are two different ways about the core umbraco
validation. Some validations are performed client side, some server side.
There seems to be no fixed choose of whether to do only one or the other
right now, so I think at least for the time being we can make do with the
pure client side validation.
I can't remember the issue number right now, but there's actually an issue
in the core that causes duplicate content creation as a result of server
side validation failures. As long as that's not fixed (l will have to look
it up when I get home next week) we should definitely stick to client side
validation.
On 20 Jun 2014 17:25, "Kevin Giszewski" notifications@github.com wrote:

Are you wanting the Archetype to save if invalid? Just not publish? I'm
not sure that will be possible.


Reply to this email directly or view it on GitHub
#151 (comment).

@kgiszewski
Copy link
Owner

@kjac well put. I think the status quo will have to persist.

@abriggs-eduserv
Copy link
Author

I think this is a fairly major issue - the ability to save "Work in progress" content has been available in all versions of Umbraco.

How do the built-in property editors allow the save to complete with validation failures? Is it because they have server side validation registered?

If issue U4-4782 is the blocker for this, can anyone affected by this vote for that issue please?

@kgiszewski
Copy link
Owner

@abriggs-eduserv To summarize what I think your issue is trying to state, you'd like to be able to save a document even if validation fails.

I just created a document with a MNTP with max nodes of 2 (like your OP). I am unable to save a non-Archetype document as 'work in progress' with your example. From my tests Archetype works just like core properties when it comes to validation. Both the MNTP and Archetype prevent saving or save/publish if validation fails. I would suggest you create an Umbraco core issue if you'd like different behavior.

I am unaware of any server-side validation that occurs in Umbraco 7.

@abriggs-eduserv
Copy link
Author

Thanks for looking into this Kevin - I had only tested this with a required "Umbraco.MediaPicker" property. You can leave this empty and the node is saved which was the behavior I was expecting so I didn't investigate any further - the validation message does come from the server in this scenario

I look at the behavior of some more of the built-in property editors later in the week.

Cheers,

@kjac
Copy link
Contributor

kjac commented Jun 24, 2014

Hey ... whoa my email reply from the lousy hotel WiFi actually made it here, cool :)

Just to clarify... it's indeed U4-4782 that's causing the duplicate content, whenever server side validation fails. Due to the potentially complex nature of an Archetype, the probability of server side validation errors must be considered higher than for normal property editors. Thus, as long as this issue has not been resolved, the probability of Archetype being the initial cause for duplicate content must be considered equally higher. In my opinion we shouldn't consider implementing server side validations until U4-4782 has been solved.

As for the general mess of server/client side validation... if you take a simple text string property editor (the built-in one) and make it mandatory, the validation is performed client side - you can't save the document unless you enter something. However, regex validation of the same field is done server side. Go figure. As @abriggs-eduserv correctly states, this has the effect that you can save an invalid draft of a document.

Personally I like the ability to save draft versions, if nothing else then to provide the editors with that flexibility. It's also somewhat of a rewrite to implement (partial) server side validation, but on the upside, server side validation might give us more options to write custom validations for specific property editors as the need arises.

@kipusoep
Copy link

This is kind of annoying, I'm trying to save a new Node without all the data and I just can't.

@kgiszewski
Copy link
Owner

@kipusoep Could you set your Archetype to start with no nodes at all?

Config->Check Start with Add

@kgiszewski
Copy link
Owner

I have a fix that depends on a core PR: umbraco/Umbraco-CMS#949
The local branch is here: #311

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

No branches or pull requests

4 participants