Ensures that the PublishedContent culture dictionary is CultureInvariantIgnoreCase and fixes the publish dialog to allow publishing the current culture if the user has edited it

This commit is contained in:
Shannon
2018-05-08 13:50:39 +10:00
parent 177bba5e73
commit 7728dfa853
2 changed files with 14 additions and 2 deletions

View File

@@ -318,7 +318,19 @@
// TODO: Add "..." to publish button label if there are more than one variant to publish - currently it just adds the elipses if there's more than 1 variant
if ($scope.content.variants.length > 1) {
//before we launch the dialog we want to execute all client side validations first
if (formHelper.submitForm({ scope: $scope, action: "publish" })) {
if (formHelper.submitForm({ scope: $scope, action: "publish", formCtrl: $scope.contentForm })) {
//we need to check if the current form is dirty and if so we need to update the current variant's isEdited property to true
//so that the publish dialog knows that it's a dirty culture and that it should be allowed to be published
if ($scope.contentForm.$dirty) {
_.each($scope.content.variants, function (d) {
//set the isEdited flag if it's the current one
if (d.current === true) {
d.isEdited = true;
}
});
}
var dialog = {
title: localizationService.localize("content_readyToPublish"),
view: "publish",

View File

@@ -266,7 +266,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
if (_contentData.CultureInfos == null)
throw new Exception("oops: _contentDate.CultureInfos is null.");
return _cultureInfos = _contentData.CultureInfos
.ToDictionary(x => x.Key, x => new PublishedCultureInfo(x.Key, x.Value.Name, x.Value.Date));
.ToDictionary(x => x.Key, x => new PublishedCultureInfo(x.Key, x.Value.Name, x.Value.Date), StringComparer.InvariantCultureIgnoreCase);
}
}