-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
v8 - Fixes multiple issues with variant validation #4955
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ghost
assigned Shazwazza
Mar 12, 2019
bjarnef
reviewed
Mar 12, 2019
@@ -365,7 +365,7 @@ | |||
action: action, | |||
variants: _.map(displayModel.variants, function(v) { | |||
return { | |||
name: v.name, | |||
name: v.name ? v.name : "", //if its null/empty,we must pass up an empty string else we get json converter errors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Shazwazza I think this also can be written as name: v.name || ""
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bjarnef ah of course, i always forget about that operator in JS thanks!
…t-validation-fixes-4884
…t-validation-fixes-4884
…nly the cultures passed in to to the method, removes client side name check,
…rom the publish dialog since it's not needed
Shazwazza
changed the title
WIP - Fixes how critical data is validated
v8 - Fixes multiple issues with variant validation
Mar 14, 2019
…andatory language has validation problems
…t-validation-fixes-4884
…tent publish dialog is invalid
…for publish/schedule
ghost
assigned robert-cpl
Mar 19, 2019
…dated on the default lang or if the item is not published
# Conflicts: # src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml
…ures since it wouldn't actually save the content if it was invalid - we always must save even if data is invalid, this was an oversight with the rush to release with these last minute APIs
ghost
assigned zpqrtbnk
Apr 1, 2019
…ted with invariant property issues
…github.com/umbraco/Umbraco-CMS into temp8-server-content-validation-fixes-4884
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #4884
This PR fixes/updates several things:
Name
is empty. If that were attempted an exception would be thrown. The UI should prevent that from happening but the c# should always validate that, so this is fixedContentService.SaveAndPublish
has been fixed, previously if the user had only selected 2 out of 3 cultures to publish and the other culture had invalid/empty properties, theContentService.SaveAndPublish
would still validate all 3 cultures! This meant that the user would get back some strange warnings and nothing would actually be persisted.To see the changed files without whitespace changes, use this: https://github.com/umbraco/Umbraco-CMS/pull/4955/files?w=1
I have renamed a couple classes to clean things up a little, added some tests and notes.
Testing ... well there's a lot of combinations to test here so please use your imagination. Pro tip #1:
Create 2 mandatory langs, a variant doc type with 2 text properties that both validate as mandatory and as a Number and make one of those properties invariant.
This will give you a nice testing ground for server side validation with mandatory requirements, then test creating new content, updating content, with valid/invalid combinations. Pro tip #2: If you navigate to a language, enter a value for it's name and then clear that value it will be marked as dirty, then navigate to another language and go to save/publish, it will still allow you to try to publish the other language even though the name is null. Server side validation will take care of this, but its another combination to test.
Then be sure that invariant content validation still works as expected too.