Fixes Content List View installation, removes unecessary properties from the RecycleBinEventArgs, updates both the upload and image cropper property editors to properly remove all files including any associated with variants, updates several other places to deal with variants and Property.GetValue(langId), adds notes, ensures we are returning the corect IDictionary instead of Dictionary for some interfaces

This commit is contained in:
Shannon
2018-04-04 13:11:12 +10:00
parent b1d309aa16
commit a673babfb7
36 changed files with 189 additions and 248 deletions

View File

@@ -21,6 +21,7 @@ namespace Umbraco.Core.Models
var val = media.Properties[propertyType];
if (val == null) return string.Empty;
//fixme doesn't take into account variants
var jsonString = val.GetValue() as string;
if (jsonString == null) return string.Empty;

View File

@@ -89,7 +89,7 @@ namespace Umbraco.Core.Models
/// Gets the list of values.
/// </summary>
[DataMember]
public List<PropertyValue> Values
public IReadOnlyCollection<PropertyValue> Values
{
get => _values;
set

View File

@@ -112,6 +112,7 @@ namespace Umbraco.Core.Models
private static void RemoveTags(this Property property, IEnumerable<string> tags, TagsStorageType storageType, char delimiter)
{
// already empty = nothing to do
//fixme doesn't take into account variants
var value = property.GetValue()?.ToString();
if (string.IsNullOrWhiteSpace(value)) return;
@@ -145,6 +146,7 @@ namespace Umbraco.Core.Models
{
if (property == null) throw new ArgumentNullException(nameof(property));
//fixme doesn't take into account variants
var value = property.GetValue()?.ToString();
if (string.IsNullOrWhiteSpace(value)) return Enumerable.Empty<string>();
@@ -154,6 +156,7 @@ namespace Umbraco.Core.Models
return value.Split(new[] { delimiter }, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim());
case TagsStorageType.Json:
//fixme doesn't take into account variants
return JsonConvert.DeserializeObject<JArray>(property.GetValue().ToString()).Select(x => x.ToString().Trim());
default: