From 5abbca0f5da48d028db3df7d7ba7e58c2c01b905 Mon Sep 17 00:00:00 2001 From: Darren Ferguson Date: Wed, 14 May 2014 11:32:39 +0100 Subject: [PATCH 01/16] Adding extension methods to PartialViewMacroModel to allow: Model.GetParameterValue("datey") Model.GetParameterValue("booly", 8) //optional default value if parsing can't happen Model.GetParameterValue("booly",8) // can be used like this as type is implied by default value argument --- .../Models/PartialViewMacroModelExtensions.cs | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/Umbraco.Web/Models/PartialViewMacroModelExtensions.cs diff --git a/src/Umbraco.Web/Models/PartialViewMacroModelExtensions.cs b/src/Umbraco.Web/Models/PartialViewMacroModelExtensions.cs new file mode 100644 index 0000000000..8b4c8ed224 --- /dev/null +++ b/src/Umbraco.Web/Models/PartialViewMacroModelExtensions.cs @@ -0,0 +1,38 @@ +using Umbraco.Core; + +namespace Umbraco.Web.Models +{ + /// + /// Extension methods for the PartialViewMacroModel object + /// + public static class PartialViewMacroModelExtensions + { + /// + /// Attempt to get a Marco parameter from a PartialViewMacroModel and return a default value otherwise + /// + /// + /// + /// + /// Parameter value if available, the default value that was passed otherwise. + public static T GetParameterValue(this PartialViewMacroModel partialViewMacroModel, string parameterAlias, T defaultValue) + { + if (partialViewMacroModel.MacroParameters.ContainsKey(parameterAlias) == false || string.IsNullOrEmpty(partialViewMacroModel.MacroParameters[parameterAlias].ToString())) + return defaultValue; + + var attempt = partialViewMacroModel.MacroParameters[parameterAlias].TryConvertTo(typeof(T)); + + return attempt.Success ? (T) attempt.Result : defaultValue; + } + + /// + /// Attempt to get a Marco parameter from a PartialViewMacroModel + /// + /// + /// + /// Parameter value if available, the default value for the type otherwise. + public static T GetParameterValue(this PartialViewMacroModel partialViewMacroModel, string parameterAlias) + { + return partialViewMacroModel.GetParameterValue(parameterAlias, default(T)); + } + } +} From a2a81222e6afc5b4c0cb1af9f0be23077ea8410c Mon Sep 17 00:00:00 2001 From: Darren Ferguson Date: Wed, 14 May 2014 11:33:40 +0100 Subject: [PATCH 02/16] Adding extension methods to PartialViewMacroModel to allow: Model.GetParameterValue("datey") Model.GetParameterValue("booly", 8) //optional default value if parsing can't happen Model.GetParameterValue("booly",8) // can be used like this as type is implied by default value argument --- src/Umbraco.Web/Models/PartialViewMacroModelExtensions.cs | 2 +- src/Umbraco.Web/Umbraco.Web.csproj | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web/Models/PartialViewMacroModelExtensions.cs b/src/Umbraco.Web/Models/PartialViewMacroModelExtensions.cs index 8b4c8ed224..0c35e9d6ef 100644 --- a/src/Umbraco.Web/Models/PartialViewMacroModelExtensions.cs +++ b/src/Umbraco.Web/Models/PartialViewMacroModelExtensions.cs @@ -24,7 +24,7 @@ namespace Umbraco.Web.Models return attempt.Success ? (T) attempt.Result : defaultValue; } - /// + /// /// Attempt to get a Marco parameter from a PartialViewMacroModel /// /// diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 03f5c397c9..98470bcf8e 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -353,6 +353,7 @@ + From b656db3af37b94cb1321404dccc0dce430eac8f3 Mon Sep 17 00:00:00 2001 From: Tom Fulton Date: Fri, 16 May 2014 21:59:34 -0600 Subject: [PATCH 03/16] Allow colors to be toggled on/off in Color Picker - U4-4935 --- .../colorpicker/colorpicker.controller.js | 9 +++++++-- .../views/propertyeditors/colorpicker/colorpicker.html | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/colorpicker/colorpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/colorpicker/colorpicker.controller.js index fb45b83fa0..89bc626d6a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/colorpicker/colorpicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/colorpicker/colorpicker.controller.js @@ -1,6 +1,11 @@ function ColorPickerController($scope) { - $scope.selectItem = function (color) { - $scope.model.value = color; + $scope.toggleItem = function (color) { + if ($scope.model.value == color) { + $scope.model.value = ""; + } + else { + $scope.model.value = color; + } }; $scope.isConfigured = $scope.model.config && $scope.model.config.items && _.keys($scope.model.config.items).length > 0; } diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/colorpicker/colorpicker.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/colorpicker/colorpicker.html index f8395296b7..d2bf2cf87c 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/colorpicker/colorpicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/colorpicker/colorpicker.html @@ -6,7 +6,7 @@
  • - +
  • From 1cf40aca07ee5f48baac2b2f013f5e6482bfa243 Mon Sep 17 00:00:00 2001 From: Stephan Date: Thu, 22 May 2014 18:31:11 +0200 Subject: [PATCH 04/16] U4-4922 - add details to error message --- .../Dynamics/DynamicInstanceHelper.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Umbraco.Core/Dynamics/DynamicInstanceHelper.cs b/src/Umbraco.Core/Dynamics/DynamicInstanceHelper.cs index 91004fa114..95ed389a7a 100644 --- a/src/Umbraco.Core/Dynamics/DynamicInstanceHelper.cs +++ b/src/Umbraco.Core/Dynamics/DynamicInstanceHelper.cs @@ -117,13 +117,12 @@ namespace Umbraco.Core.Dynamics } catch (Exception ex) { - var sb = new StringBuilder("An error occurred finding an executing an extension method for type "); - sb.Append(typeof (T)); - sb.Append("Types searched for extension methods were "); - foreach(var t in findExtensionMethodsOnTypes) - { - sb.Append(t + ","); - } + var sb = new StringBuilder(); + sb.AppendFormat("An error occurred finding and executing extension method \"{0}\" ", binder.Name); + sb.AppendFormat("for type \"{0}\". ", typeof (T)); + sb.Append("Types searched for extension methods were "); + sb.Append(string.Join(", ", findExtensionMethodsOnTypes)); + sb.Append("."); LogHelper.Error(sb.ToString(), ex); var mresult = new TryInvokeMemberResult(null, TryInvokeMemberSuccessReason.FoundExtensionMethod); return Attempt.Fail(mresult, ex); @@ -171,7 +170,7 @@ namespace Umbraco.Core.Dynamics } else { - throw new MissingMethodException(); + throw new MissingMethodException(typeof(T).FullName, name); } return result; } From 8fb446960c12d147950430712ac099d3c5a0c5e0 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 22 May 2014 19:39:25 +0200 Subject: [PATCH 05/16] U4-4927 Image Cropper Crop URL is wrong in 6.2.0 Reverts part of 067268a96e472a888aeeae10762b0967b4127a99 which was refactored wrong --- .../imagecropper/ImageInfo.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/umbraco.editorControls/imagecropper/ImageInfo.cs b/src/umbraco.editorControls/imagecropper/ImageInfo.cs index b2fe94365e..addd629880 100644 --- a/src/umbraco.editorControls/imagecropper/ImageInfo.cs +++ b/src/umbraco.editorControls/imagecropper/ImageInfo.cs @@ -32,9 +32,12 @@ namespace umbraco.editorControls.imagecropper //This get's the IFileSystem's path based on the URL (i.e. /media/blah/blah.jpg ) Path = _fs.GetRelativePath(relativePath); - + image = Image.FromStream(_fs.OpenFile(Path)); - Name = _fs.GetFileName(Path); + + var fileName = _fs.GetFileName(Path); + Name = fileName.Substring(0, fileName.LastIndexOf('.')); + DateStamp = _fs.GetLastModified(Path).Date; Width = image.Width; Height = image.Height; @@ -74,12 +77,10 @@ namespace umbraco.editorControls.imagecropper { crop = preset.Fit(this); } - - var tmpName = Name.Substring(0, Name.LastIndexOf('.')); - + ImageTransform.Execute( Path, - String.Format("{0}_{1}", tmpName, preset.Name), + String.Format("{0}_{1}", Name, preset.Name), crop.X, crop.Y, crop.X2 - crop.X, From 95b9a46b88d1afd56c1ec9b6cf17af7e78c40a78 Mon Sep 17 00:00:00 2001 From: Stephan Date: Mon, 26 May 2014 15:02:05 +0200 Subject: [PATCH 06/16] U4-4928 - issue with missing media content properties --- .../XmlPublishedCache/PublishedMediaCache.cs | 63 +++++++++---------- 1 file changed, 28 insertions(+), 35 deletions(-) diff --git a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs index 06da0c807d..7488b097ac 100644 --- a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs +++ b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs @@ -464,6 +464,10 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache // I'm not sure that _properties contains all properties including those without a value, // neither that GetProperty will return a property without a value vs. null... @zpqrtbnk + // List of properties that will appear in the XML and do not match + // anything in the ContentType, so they must be ignored. + private static readonly string[] IgnoredKeys = { "version", "isDoc", "key" }; + public DictionaryPublishedContent( IDictionary valueDictionary, Func getParent, @@ -509,47 +513,36 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache _contentType = PublishedContentType.Get(PublishedItemType.Media, _documentTypeAlias); _properties = new Collection(); + //handle content type properties + //make sure we create them even if there's no value + foreach (var propertyType in _contentType.PropertyTypes) + { + var alias = propertyType.PropertyTypeAlias; + _keysAdded.Add(alias); + string value; + const bool isPreviewing = false; // false :: never preview a media + var property = valueDictionary.TryGetValue(alias, out value) == false + ? new XmlPublishedProperty(propertyType, isPreviewing) + : new XmlPublishedProperty(propertyType, isPreviewing, value); + _properties.Add(property); + } + //loop through remaining values that haven't been applied - foreach (var i in valueDictionary.Where(x => !_keysAdded.Contains(x.Key))) + foreach (var i in valueDictionary.Where(x => + _keysAdded.Contains(x.Key) == false // not already processed + && IgnoredKeys.Contains(x.Key) == false)) // not ignorable { - IPublishedContentProperty property; - - // must ignore that one - if (i.Key == "version" || i.Key == "isDoc") continue; - if (i.Key.InvariantStartsWith("__")) - { - // no type for tha tone, dunno how to convert - property = new PropertyResult(i.Key, i.Value, Guid.Empty, PropertyResultType.CustomProperty); - } + { + // no type for that one, dunno how to convert + IPublishedContentProperty property = new PropertyResult(i.Key, i.Value, Guid.Empty, PropertyResultType.CustomProperty); + _properties.Add(property); + } else { - // use property type to ensure proper conversion - var propertyType = _contentType.GetPropertyType(i.Key); - - // note: this is where U4-4144 and -3665 were born - // - // because propertyType is null, the XmlPublishedProperty ctor will throw - // it's null because i.Key is not a valid property alias for the type... - // the alias is case insensitive (verified) so it means it really is not - // a correct alias. - // - // in every cases this is after a ConvertFromXPathNavigator, so it means - // that we get some properties from the XML that are not valid properties. - // no idea which property. could come from the cache in library, could come - // from so many places really. - - // workaround: just ignore that property - if (propertyType == null) - { - LogHelper.Warn("Dropping property \"" + i.Key + "\" because it does not belong to the content type."); - continue; - } - - property = new XmlPublishedProperty(propertyType, false, i.Value); // false :: never preview a media + // this is a property that does not correspond to anything, ignore and log + LogHelper.Warn("Dropping property \"" + i.Key + "\" because it does not belong to the content type."); } - - _properties.Add(property); } } From b1e879bf68a60711bfd7e9fa45b0291d2784737f Mon Sep 17 00:00:00 2001 From: Stephan Date: Mon, 26 May 2014 15:01:06 +0200 Subject: [PATCH 07/16] U4-4928 - issue with missing media content properties --- .../XmlPublishedCache/PublishedMediaCache.cs | 57 ++++++++----------- 1 file changed, 23 insertions(+), 34 deletions(-) diff --git a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs index 8842715bd3..152db6ec97 100644 --- a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs +++ b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs @@ -514,47 +514,36 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache _contentType = PublishedContentType.Get(PublishedItemType.Media, _documentTypeAlias); _properties = new Collection(); + //handle content type properties + //make sure we create them even if there's no value + foreach (var propertyType in _contentType.PropertyTypes) + { + var alias = propertyType.PropertyTypeAlias; + _keysAdded.Add(alias); + string value; + const bool isPreviewing = false; // false :: never preview a media + var property = valueDictionary.TryGetValue(alias, out value) == false + ? new XmlPublishedProperty(propertyType, isPreviewing) + : new XmlPublishedProperty(propertyType, isPreviewing, value); + _properties.Add(property); + } + //loop through remaining values that haven't been applied - foreach (var i in valueDictionary.Where(x => !_keysAdded.Contains(x.Key))) + foreach (var i in valueDictionary.Where(x => + _keysAdded.Contains(x.Key) == false // not already processed + && IgnoredKeys.Contains(x.Key) == false)) // not ignorable { - IPublishedProperty property = null; - - // must ignore those - if (IgnoredKeys.Contains(i.Key)) continue; - if (i.Key.InvariantStartsWith("__")) - { + { // no type for that one, dunno how to convert - property = new PropertyResult(i.Key, i.Value, PropertyResultType.CustomProperty); - } + IPublishedProperty property = new PropertyResult(i.Key, i.Value, PropertyResultType.CustomProperty); + _properties.Add(property); + } else { - // use property type to ensure proper conversion - var propertyType = _contentType.GetPropertyType(i.Key); - - // note: this is where U4-4144 and -3665 were born - // - // because propertyType is null, the XmlPublishedProperty ctor will throw - // it's null because i.Key is not a valid property alias for the type... - // the alias is case insensitive (verified) so it means it really is not - // a correct alias. - // - // in every cases this is after a ConvertFromXPathNavigator, so it means - // that we get some properties from the XML that are not valid properties. - // no idea which property. could come from the cache in library, could come - // from so many places really. - - // workaround: just ignore that property - if (propertyType == null) - { - LogHelper.Warn("Dropping property \"" + i.Key + "\" because it does not belong to the content type."); - continue; - } - - property = new XmlPublishedProperty(propertyType, false, i.Value); // false :: never preview a media + // this is a property that does not correspond to anything, ignore and log + LogHelper.Warn("Dropping property \"" + i.Key + "\" because it does not belong to the content type."); } - - _properties.Add(property); } } From d631039c0dcdfcf3e9f4fa71c7ef43dcd578ca83 Mon Sep 17 00:00:00 2001 From: Stephan Date: Mon, 26 May 2014 18:07:20 +0200 Subject: [PATCH 08/16] U4-4928 - issue with missing media content properties --- src/Umbraco.Web/Models/PublishedContentBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web/Models/PublishedContentBase.cs b/src/Umbraco.Web/Models/PublishedContentBase.cs index e59c2981cb..9eab1a9dc6 100644 --- a/src/Umbraco.Web/Models/PublishedContentBase.cs +++ b/src/Umbraco.Web/Models/PublishedContentBase.cs @@ -47,7 +47,7 @@ namespace Umbraco.Web.Models var prop = GetProperty(Constants.Conventions.Media.File); if (prop == null) throw new NotSupportedException("Cannot resolve a Url for a media item when there is no 'umbracoFile' property defined."); - _url = prop.Value.ToString(); + _url = prop.Value == null ? "" : prop.Value.ToString(); break; default: throw new NotSupportedException(); From 13e8e972ebbf2f18199566327af605a3ec1f790b Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Tue, 27 May 2014 11:43:24 +0200 Subject: [PATCH 09/16] U4-4956 UserService.SavePassword method always throws a not supported exception --- src/Umbraco.Core/Services/UserService.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Core/Services/UserService.cs b/src/Umbraco.Core/Services/UserService.cs index d2a58b6ad8..2874aa4aaa 100644 --- a/src/Umbraco.Core/Services/UserService.cs +++ b/src/Umbraco.Core/Services/UserService.cs @@ -205,10 +205,11 @@ namespace Umbraco.Core.Services if (user == null) throw new ArgumentNullException("user"); var provider = MembershipProviderExtensions.GetUsersMembershipProvider(); - if (provider.IsUmbracoMembershipProvider()) - { - provider.ChangePassword(user.Username, "", password); - } + + if (provider.IsUmbracoMembershipProvider() == false) + throw new NotSupportedException("When using a non-Umbraco membership provider you must change the user password by using the MembershipProvider.ChangePassword method"); + + provider.ChangePassword(user.Username, "", password); //go re-fetch the member and update the properties that may have changed var result = GetByUsername(user.Username); @@ -219,8 +220,6 @@ namespace Umbraco.Core.Services user.LastPasswordChangeDate = result.LastPasswordChangeDate; user.UpdateDate = user.UpdateDate; } - - throw new NotSupportedException("When using a non-Umbraco membership provider you must change the user password by using the MembershipProvider.ChangePassword method"); } /// From 524d6fb76a5b2796ad6bd78364ccf14249e98efd Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Tue, 27 May 2014 12:12:22 +0200 Subject: [PATCH 10/16] U4-4914 Add icon for 'Import Document Type' action menu --- src/umbraco.cms/Actions/ActionImport.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/umbraco.cms/Actions/ActionImport.cs b/src/umbraco.cms/Actions/ActionImport.cs index 71469c964d..85ccd10c2d 100644 --- a/src/umbraco.cms/Actions/ActionImport.cs +++ b/src/umbraco.cms/Actions/ActionImport.cs @@ -65,7 +65,7 @@ namespace umbraco.BusinessLogic.Actions { get { - return "upload-alt"; + return "page-up"; } } From f5194efb6e47aabaf76a520e62d0562763e182dc Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 28 May 2014 12:29:41 +1000 Subject: [PATCH 11/16] Fixes: U4-4999 Image cropper - Image file duplicated each time the page (content) is saved/published --- .../fileupload/fileupload.controller.js | 6 +++--- .../imagecropper/imagecropper.controller.js | 7 +++++++ .../ImageCropperPropertyValueEditor.cs | 18 ++++++++++++++++-- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/fileupload/fileupload.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/fileupload/fileupload.controller.js index 7aa65473a6..9106e2b334 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/fileupload/fileupload.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/fileupload/fileupload.controller.js @@ -25,6 +25,9 @@ function fileUploadController($scope, $element, $compile, imageHelper, fileManag /** this method is used to initialize the data and to re-initialize it if the server value is changed */ function initialize(index) { + + clearFiles(); + if (!index) { index = 1; } @@ -116,9 +119,6 @@ function fileUploadController($scope, $element, $compile, imageHelper, fileManag initialize($scope.rebuildInput.index + 1); } - //if (newVal !== "{clearFiles: true}" && newVal !== $scope.originalValue && !newVal.startsWith("{selectedFiles:")) { - // initialize($scope.rebuildInput.index + 1); - //} } }); }; diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.controller.js index 7189ca504a..42eee9b4a8 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.controller.js @@ -88,6 +88,13 @@ angular.module('umbraco') } }); + + //here we declare a special method which will be called whenever the value has changed from the server + $scope.model.onValueChanged = function (newVal, oldVal) { + //clear current uploaded files + fileManager.setFiles($scope.model.alias, []); + }; + var unsubscribe = $scope.$on("formSubmitting", function () { $scope.done(); }); diff --git a/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyValueEditor.cs b/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyValueEditor.cs index 2f06aaebcd..72b5aa1e62 100644 --- a/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyValueEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyValueEditor.cs @@ -10,6 +10,7 @@ using System.Threading.Tasks; using Umbraco.Core; using Umbraco.Core.Configuration; using Umbraco.Core.IO; +using Umbraco.Core.Logging; using Umbraco.Core.Media; using Umbraco.Core.Models; using Umbraco.Core.Models.Editors; @@ -50,11 +51,22 @@ namespace Umbraco.Web.PropertyEditors JObject oldJson = null; //get the old src path - if (currentValue != null) + if (string.IsNullOrEmpty(currentValue.ToString()) == false) { - oldJson = currentValue as JObject; + try + { + oldJson = JObject.Parse(currentValue.ToString()); + } + catch (Exception ex) + { + //for some reason the value is invalid so continue as if there was no value there + LogHelper.WarnWithException("Could not parse current db value to a JObject", ex); + } + if (oldJson != null && oldJson["src"] != null) + { oldFile = oldJson["src"].Value(); + } } //get the new src path @@ -62,7 +74,9 @@ namespace Umbraco.Web.PropertyEditors { newJson = editorValue.Value as JObject; if (newJson != null && newJson["src"] != null) + { newFile = newJson["src"].Value(); + } } //compare old and new src path From fce8c9d3ec231b160c38d5407d10546b54240abc Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 28 May 2014 12:38:11 +1000 Subject: [PATCH 12/16] Fixes: U4-4141 7.0.2 "Save and send for approval" fails for a writer user on a newly created unsaved content page --- src/Umbraco.Core/Services/ContentService.cs | 4 ++-- src/umbraco.cms/businesslogic/web/Document.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Core/Services/ContentService.cs b/src/Umbraco.Core/Services/ContentService.cs index 846498a3fb..c597cc7b3e 100644 --- a/src/Umbraco.Core/Services/ContentService.cs +++ b/src/Umbraco.Core/Services/ContentService.cs @@ -1224,8 +1224,8 @@ namespace Umbraco.Core.Services if (SendingToPublish.IsRaisedEventCancelled(new SendToPublishEventArgs(content), this)) return false; - //TODO: Do some stuff here.. ... what is it supposed to do ? - // pretty sure all that legacy stuff did was raise an event? and we no longer have IActionHandlers so no worries there. + //Save before raising event + Save(content, userId); SentToPublish.RaiseEvent(new SendToPublishEventArgs(content, false), this); diff --git a/src/umbraco.cms/businesslogic/web/Document.cs b/src/umbraco.cms/businesslogic/web/Document.cs index 098d3c87ed..44d22945c5 100644 --- a/src/umbraco.cms/businesslogic/web/Document.cs +++ b/src/umbraco.cms/businesslogic/web/Document.cs @@ -748,7 +748,7 @@ namespace umbraco.cms.businesslogic.web #region Public Methods /// - /// Executes handlers and events for the Send To Publication action. + /// Saves and executes handlers and events for the Send To Publication action. /// /// The User public bool SendToPublication(User u) From 2ede32fe700e86504ca4f52438e7ff326a8f76a7 Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 28 May 2014 12:39:12 +1000 Subject: [PATCH 13/16] minor change, using non obsolete user id --- src/Umbraco.Web/Editors/ContentController.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web/Editors/ContentController.cs b/src/Umbraco.Web/Editors/ContentController.cs index 47c8d167d7..d2a023ee98 100644 --- a/src/Umbraco.Web/Editors/ContentController.cs +++ b/src/Umbraco.Web/Editors/ContentController.cs @@ -269,16 +269,16 @@ namespace Umbraco.Web.Editors if (contentItem.Action == ContentSaveAction.Save || contentItem.Action == ContentSaveAction.SaveNew) { //save the item - Services.ContentService.Save(contentItem.PersistedContent, (int)Security.CurrentUser.Id); + Services.ContentService.Save(contentItem.PersistedContent, Security.CurrentUser.Id); } else if (contentItem.Action == ContentSaveAction.SendPublish || contentItem.Action == ContentSaveAction.SendPublishNew) { - Services.ContentService.SendToPublication(contentItem.PersistedContent, UmbracoUser.Id); + Services.ContentService.SendToPublication(contentItem.PersistedContent, Security.CurrentUser.Id); } else { //publish the item and check if it worked, if not we will show a diff msg below - publishStatus = Services.ContentService.SaveAndPublishWithStatus(contentItem.PersistedContent, (int)Security.CurrentUser.Id); + publishStatus = Services.ContentService.SaveAndPublishWithStatus(contentItem.PersistedContent, Security.CurrentUser.Id); } From d987dfb5a2a34acd9423faca78efb9d44db3ab79 Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 28 May 2014 12:40:43 +1000 Subject: [PATCH 14/16] Fixes: U4-4141 7.0.2 "Save and send for approval" fails for a writer user on a newly created unsaved content page --- src/Umbraco.Core/Services/ContentService.cs | 4 ++-- src/umbraco.cms/businesslogic/web/Document.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Core/Services/ContentService.cs b/src/Umbraco.Core/Services/ContentService.cs index 49e59550ee..2d2481d385 100644 --- a/src/Umbraco.Core/Services/ContentService.cs +++ b/src/Umbraco.Core/Services/ContentService.cs @@ -1263,8 +1263,8 @@ namespace Umbraco.Core.Services if (SendingToPublish.IsRaisedEventCancelled(new SendToPublishEventArgs(content), this)) return false; - //TODO: Do some stuff here.. ... what is it supposed to do ? - // pretty sure all that legacy stuff did was raise an event? and we no longer have IActionHandlers so no worries there. + //Save before raising event + Save(content, userId); SentToPublish.RaiseEvent(new SendToPublishEventArgs(content, false), this); diff --git a/src/umbraco.cms/businesslogic/web/Document.cs b/src/umbraco.cms/businesslogic/web/Document.cs index 6255a7b2eb..479fb055c6 100644 --- a/src/umbraco.cms/businesslogic/web/Document.cs +++ b/src/umbraco.cms/businesslogic/web/Document.cs @@ -750,7 +750,7 @@ namespace umbraco.cms.businesslogic.web #region Public Methods /// - /// Executes handlers and events for the Send To Publication action. + /// Saves and executes handlers and events for the Send To Publication action. /// /// The User public bool SendToPublication(User u) From 2a0d2bdb86b265bd3c4177cefb0807da9b858dd9 Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 28 May 2014 13:25:47 +1000 Subject: [PATCH 15/16] Fixes: U4-4945 Slider type stops working on ajax load in 7.1.3 --- .../src/views/propertyeditors/slider/slider.controller.js | 6 ++++++ .../src/views/propertyeditors/slider/slider.html | 8 +------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/slider/slider.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/slider/slider.controller.js index 48a7dbd611..692d2dbc99 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/slider/slider.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/slider/slider.controller.js @@ -71,6 +71,12 @@ //initiate slider, add event handler and get the instance reference (stored in data) var slider = $element.find('.slider-item').slider({ + max: $scope.model.config.maxVal, + min: $scope.model.config.minVal, + orientation: $scope.model.config.orientation, + selection: "after", + step: $scope.model.config.step, + tooltip: "show", //set the slider val - we cannot do this with data- attributes when using ranges value: sliderVal }).on('slideStop', function () { diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/slider/slider.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/slider/slider.html index ce05e865fb..66fc61153a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/slider/slider.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/slider/slider.html @@ -1,11 +1,5 @@ 
    - +
    \ No newline at end of file From 7ec4d3f26d27f72442e96021f65bf676eb4ceef1 Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 28 May 2014 13:33:03 +1000 Subject: [PATCH 16/16] Fixes: U4-4950 U7.1.3 multiple media picker --- .../Persistence/Migrations/Initial/BaseDataCreation.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs b/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs index ace2178a55..cf78e3a5cb 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs @@ -248,6 +248,9 @@ namespace Umbraco.Core.Persistence.Migrations.Initial { _database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = 3, Alias = "", SortOrder = 0, DataTypeNodeId = -87, Value = ",code,undo,redo,cut,copy,mcepasteword,stylepicker,bold,italic,bullist,numlist,outdent,indent,mcelink,unlink,mceinsertanchor,mceimage,umbracomacro,mceinserttable,umbracoembed,mcecharmap,|1|1,2,3,|0|500,400|1049,|true|" }); _database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = 4, Alias = "group", SortOrder = 0, DataTypeNodeId = 1041, Value = "default" }); + + //default's for MultipleMediaPickerAlias picker + _database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = 5, Alias = "multiPicker", SortOrder = 0, DataTypeNodeId = 1045, Value = "1" }); } private void CreateUmbracoRelationTypeData()