Merge branch '7.1.4' into 7.1.3-variations
This commit is contained in:
@@ -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<DynamicInstanceHelper>(sb.ToString(), ex);
|
||||
var mresult = new TryInvokeMemberResult(null, TryInvokeMemberSuccessReason.FoundExtensionMethod);
|
||||
return Attempt<TryInvokeMemberResult>.Fail(mresult, ex);
|
||||
@@ -171,7 +170,7 @@ namespace Umbraco.Core.Dynamics
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new MissingMethodException();
|
||||
throw new MissingMethodException(typeof(T).FullName, name);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -1264,8 +1264,8 @@ namespace Umbraco.Core.Services
|
||||
if (SendingToPublish.IsRaisedEventCancelled(new SendToPublishEventArgs<IContent>(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<IContent>(content, false), this);
|
||||
|
||||
|
||||
@@ -207,10 +207,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);
|
||||
@@ -221,8 +222,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");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
+7
-2
@@ -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;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<ul class="thumbnails color-picker">
|
||||
<li ng-repeat="(key, val) in model.config.items" ng-class="{active: model.value === val}">
|
||||
<a ng-click="selectItem(val)" class="thumbnail" hex-bg-color="{{val}}">
|
||||
<a ng-click="toggleItem(val)" class="thumbnail" hex-bg-color="{{val}}">
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
+3
-3
@@ -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);
|
||||
//}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
+7
@@ -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();
|
||||
});
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
<div ng-controller="Umbraco.PropertyEditors.SliderController">
|
||||
|
||||
<input type="text" name="slider" class="slider-item"
|
||||
data-slider-min="{{ model.config.minVal }}"
|
||||
data-slider-max="{{ model.config.maxVal }}"
|
||||
data-slider-step="{{ model.config.step }}"
|
||||
data-slider-orientation="{{ model.config.orientation }}"
|
||||
data-slider-selection="after"
|
||||
data-slider-tooltip="show" />
|
||||
<input type="text" name="slider" class="slider-item" />
|
||||
|
||||
</div>
|
||||
@@ -274,16 +274,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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
using Umbraco.Core;
|
||||
|
||||
namespace Umbraco.Web.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Extension methods for the PartialViewMacroModel object
|
||||
/// </summary>
|
||||
public static class PartialViewMacroModelExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Attempt to get a Marco parameter from a PartialViewMacroModel and return a default value otherwise
|
||||
/// </summary>
|
||||
/// <param name="partialViewMacroModel"></param>
|
||||
/// <param name="parameterAlias"></param>
|
||||
/// <param name="defaultValue"></param>
|
||||
/// <returns>Parameter value if available, the default value that was passed otherwise.</returns>
|
||||
public static T GetParameterValue<T>(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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempt to get a Marco parameter from a PartialViewMacroModel
|
||||
/// </summary>
|
||||
/// <param name="partialViewMacroModel"></param>
|
||||
/// <param name="parameterAlias"></param>
|
||||
/// <returns>Parameter value if available, the default value for the type otherwise.</returns>
|
||||
public static T GetParameterValue<T>(this PartialViewMacroModel partialViewMacroModel, string parameterAlias)
|
||||
{
|
||||
return partialViewMacroModel.GetParameterValue(parameterAlias, default(T));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<ImageCropperPropertyValueEditor>("Could not parse current db value to a JObject", ex);
|
||||
}
|
||||
|
||||
if (oldJson != null && oldJson["src"] != null)
|
||||
{
|
||||
oldFile = oldJson["src"].Value<string>();
|
||||
}
|
||||
}
|
||||
|
||||
//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<string>();
|
||||
}
|
||||
}
|
||||
|
||||
//compare old and new src path
|
||||
|
||||
@@ -514,47 +514,36 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
_contentType = PublishedContentType.Get(PublishedItemType.Media, _documentTypeAlias);
|
||||
_properties = new Collection<IPublishedProperty>();
|
||||
|
||||
//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<PublishedMediaCache>("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<PublishedMediaCache>("Dropping property \"" + i.Key + "\" because it does not belong to the content type.");
|
||||
}
|
||||
|
||||
_properties.Add(property);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -354,6 +354,7 @@
|
||||
<Compile Include="Models\ImageCropData.cs" />
|
||||
<Compile Include="Models\ImageCropRatioMode.cs" />
|
||||
<Compile Include="Models\IRenderModel.cs" />
|
||||
<Compile Include="Models\PartialViewMacroModelExtensions.cs" />
|
||||
<Compile Include="Models\PostRedirectModel.cs" />
|
||||
<Compile Include="Models\PublishedProperty.cs" />
|
||||
<Compile Include="Models\Segments\ContentVariableSegment.cs" />
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace umbraco.BusinessLogic.Actions
|
||||
{
|
||||
get
|
||||
{
|
||||
return "upload-alt";
|
||||
return "page-up";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -749,7 +749,7 @@ namespace umbraco.cms.businesslogic.web
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Executes handlers and events for the Send To Publication action.
|
||||
/// Saves and executes handlers and events for the Send To Publication action.
|
||||
/// </summary>
|
||||
/// <param name="u">The User</param>
|
||||
public bool SendToPublication(User u)
|
||||
|
||||
@@ -33,9 +33,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;
|
||||
@@ -75,12 +78,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,
|
||||
|
||||
Reference in New Issue
Block a user