diff --git a/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editors.html b/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editors.html
index 7b46e9e33d..99f9e96765 100644
--- a/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editors.html
+++ b/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editors.html
@@ -1,9 +1,25 @@
-
diff --git a/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/TextString.cshtml b/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/TextString.cshtml
index e0db232086..2a1d63ffda 100644
--- a/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/TextString.cshtml
+++ b/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/TextString.cshtml
@@ -5,7 +5,7 @@
@if (Model.editor.config.markup != null)
{
string markup = Model.editor.config.markup.ToString();
- var umbracoHelper = new UmbracoHelper(UmbracoContext.Current, Current.Services);
+ var umbracoHelper = Current.UmbracoHelper;
markup = markup.Replace("#value#", umbracoHelper.ReplaceLineBreaksForHtml(HttpUtility.HtmlEncode(Model.value.ToString())).ToString());
if (Model.editor.config.style != null)
diff --git a/src/Umbraco.Web/Editors/ContentController.cs b/src/Umbraco.Web/Editors/ContentController.cs
index 0c3d8dfa20..ee2f2c313a 100644
--- a/src/Umbraco.Web/Editors/ContentController.cs
+++ b/src/Umbraco.Web/Editors/ContentController.cs
@@ -1151,7 +1151,6 @@ namespace Umbraco.Web.Editors
/// Performs the publishing operation for a content item
///
///
- ///
///
///
/// if the content is variant this will return an array of cultures that will be published (passed validation rules)
@@ -1200,10 +1199,12 @@ namespace Umbraco.Web.Editors
if (canPublish)
{
+ var culturesToPublish = cultureVariants.Where(x => x.Publish).Select(x => x.Culture).ToArray();
+
//proceed to publish if all validation still succeeds
- var publishStatus = Services.ContentService.SavePublishing(contentItem.PersistedContent, Security.CurrentUser.Id);
+ var publishStatus = Services.ContentService.SaveAndPublish(contentItem.PersistedContent, culturesToPublish, Security.CurrentUser.Id);
wasCancelled = publishStatus.Result == PublishResultType.FailedPublishCancelledByEvent;
- successfulCultures = contentItem.Variants.Where(x => x.Publish).Select(x => x.Culture).ToArray();
+ successfulCultures = culturesToPublish;
return publishStatus;
}
else
@@ -1222,6 +1223,10 @@ namespace Umbraco.Web.Editors
///
///
///
+ ///
+ ///
+ ///
+ ///
///
private bool ValidatePublishingMandatoryLanguages(
ContentItemSave contentItem,
@@ -1243,7 +1248,7 @@ namespace Umbraco.Web.Editors
var isPublished = contentItem.PersistedContent.Published && contentItem.PersistedContent.IsCulturePublished(culture);
result.Add((mandatoryVariant, isPublished));
- var isPublishing = isPublished ? true : publishingCheck(mandatoryVariant);
+ var isPublishing = isPublished || publishingCheck(mandatoryVariant);
if (isPublished || isPublishing) continue;
@@ -1257,7 +1262,7 @@ namespace Umbraco.Web.Editors
}
///
- /// This will call PublishCulture on the content item for each culture that needs to be published including the invariant culture
+ /// Call PublishCulture on the content item for each culture to get a validation result for each culture
///
///
///
@@ -1314,7 +1319,7 @@ namespace Umbraco.Web.Editors
return HandleContentNotFound(id, false);
}
- var publishResult = Services.ContentService.SavePublishing(foundContent, Security.GetUserId().ResultOr(0));
+ var publishResult = Services.ContentService.SaveAndPublish(foundContent, userId: Security.GetUserId().ResultOr(0));
if (publishResult.Success == false)
{
var notificationModel = new SimpleNotificationModel();
diff --git a/src/Umbraco.Web/Macros/PublishedContentHashtableConverter.cs b/src/Umbraco.Web/Macros/PublishedContentHashtableConverter.cs
index 2a3bca9c16..0ce317ac65 100644
--- a/src/Umbraco.Web/Macros/PublishedContentHashtableConverter.cs
+++ b/src/Umbraco.Web/Macros/PublishedContentHashtableConverter.cs
@@ -252,8 +252,8 @@ namespace Umbraco.Web.Macros
if (_cultureInfos != null)
return _cultureInfos;
- return _cultureInfos = _inner.PublishCultureInfos
- .ToDictionary(x => x.Key, x => new PublishedCultureInfo(x.Key, x.Value.Name, x.Value.Date));
+ return _cultureInfos = _inner.PublishCultureInfos.Values
+ .ToDictionary(x => x.Culture, x => new PublishedCultureInfo(x.Culture, x.Name, x.Date));
}
}
diff --git a/src/Umbraco.Web/Models/Mapping/ContentTypeProfileExtensions.cs b/src/Umbraco.Web/Models/Mapping/ContentTypeProfileExtensions.cs
index 0181fc25be..0e324c94b9 100644
--- a/src/Umbraco.Web/Models/Mapping/ContentTypeProfileExtensions.cs
+++ b/src/Umbraco.Web/Models/Mapping/ContentTypeProfileExtensions.cs
@@ -25,7 +25,7 @@ namespace Umbraco.Web.Models.Mapping
where TPropertyTypeBasic : PropertyTypeBasic
{
return mapping
- .ConstructUsing(x => new PropertyGroup(false)) // TODO: we have NO idea of isPublishing here = wtf?
+ .ConstructUsing(x => new PropertyGroup(false)) // TODO: we have NO idea of isPublishing here = so what?
.IgnoreEntityCommonProperties()
.ForMember(dest => dest.Id, map => map.Condition(src => src.Id > 0))
.ForMember(dest => dest.Key, map => map.Ignore())
diff --git a/src/Umbraco.Web/Models/Mapping/MemberMapperProfile.cs b/src/Umbraco.Web/Models/Mapping/MemberMapperProfile.cs
index dbdac1f91f..af894bee5e 100644
--- a/src/Umbraco.Web/Models/Mapping/MemberMapperProfile.cs
+++ b/src/Umbraco.Web/Models/Mapping/MemberMapperProfile.cs
@@ -56,6 +56,7 @@ namespace Umbraco.Web.Models.Mapping
.ForMember(dest => dest.FailedPasswordAttempts, opt => opt.Ignore())
.ForMember(dest => dest.DeleteDate, opt => opt.Ignore())
.ForMember(dest => dest.WriterId, opt => opt.Ignore())
+ .ForMember(dest => dest.VersionId, opt => opt.Ignore())
// TODO: Support these eventually
.ForMember(dest => dest.PasswordQuestion, opt => opt.Ignore())
.ForMember(dest => dest.RawPasswordAnswerValue, opt => opt.Ignore());
diff --git a/src/Umbraco.Web/PropertyEditors/NestedContentPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/NestedContentPropertyEditor.cs
index 7ff6439e08..6dee2f78b5 100644
--- a/src/Umbraco.Web/PropertyEditors/NestedContentPropertyEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/NestedContentPropertyEditor.cs
@@ -172,18 +172,16 @@ namespace Umbraco.Web.PropertyEditors
try
{
// create a temp property with the value
+ // - force it to be culture invariant as NC can't handle culture variant element properties
+ propType.Variations = ContentVariation.Nothing;
var tempProp = new Property(propType);
- // if the property varies by culture, make sure we save using the current culture
- var propCulture = propType.VariesByCulture() || propType.VariesByCultureAndSegment()
- ? culture
- : null;
- tempProp.SetValue(propValues[propAlias] == null ? null : propValues[propAlias].ToString(), propCulture);
+ tempProp.SetValue(propValues[propAlias] == null ? null : propValues[propAlias].ToString());
// convert that temp property, and store the converted value
var propEditor = _propertyEditors[propType.PropertyEditorAlias];
var tempConfig = dataTypeService.GetDataType(propType.DataTypeId).Configuration;
var valEditor = propEditor.GetValueEditor(tempConfig);
- var convValue = valEditor.ToEditor(tempProp, dataTypeService, propCulture);
+ var convValue = valEditor.ToEditor(tempProp, dataTypeService);
propValues[propAlias] = convValue == null ? null : JToken.FromObject(convValue);
}
catch (InvalidOperationException)
diff --git a/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs b/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs
index 18324a473d..9845becb45 100755
--- a/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs
+++ b/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs
@@ -1239,10 +1239,11 @@ namespace Umbraco.Web.PublishedCache.NuCache
: document.CultureInfos)
: content.CultureInfos;
- foreach (var (culture, info) in infos)
+ // ReSharper disable once UseDeconstruction
+ foreach (var cultureInfo in infos)
{
- var cultureIsDraft = !published && content is IContent d && d.IsCultureEdited(culture);
- cultureData[culture] = new CultureVariation { Name = info.Name, Date = content.GetUpdateDate(culture) ?? DateTime.MinValue, IsDraft = cultureIsDraft };
+ var cultureIsDraft = !published && content is IContent d && d.IsCultureEdited(cultureInfo.Culture);
+ cultureData[cultureInfo.Culture] = new CultureVariation { Name = cultureInfo.Name, Date = content.GetUpdateDate(cultureInfo.Culture) ?? DateTime.MinValue, IsDraft = cultureIsDraft };
}
}