The content service is not returning the invalid properties when publishing fails

This commit is contained in:
Claus
2019-02-20 16:05:42 +01:00
parent 716fc582a0
commit d94e383ed7
4 changed files with 60 additions and 35 deletions

View File

@@ -193,6 +193,13 @@ namespace Umbraco.Core.Models
public static bool PublishCulture(this IContent content, string culture = "*")
{
return PublishCulture(content, out _, culture);
}
public static bool PublishCulture(this IContent content, out Property[] invalidProperties, string culture = "*")
{
invalidProperties = null;
culture = culture.NullOrWhiteSpaceAsNull();
// the variation should be supported by the content type properties
@@ -202,7 +209,8 @@ namespace Umbraco.Core.Models
throw new NotSupportedException($"Culture \"{culture}\" is not supported by content type \"{content.ContentType.Alias}\" with variation \"{content.ContentType.Variations}\".");
// the values we want to publish should be valid
if (content.ValidateProperties(culture).Any())
invalidProperties = content.ValidateProperties(culture);
if (invalidProperties.Length > 0)
return false;
var alsoInvariant = false;