From 60427155e6f1f8946ebec61c91c293070b06f590 Mon Sep 17 00:00:00 2001 From: Jeavon Date: Wed, 3 Aug 2016 10:11:03 +0100 Subject: [PATCH 1/6] Updating readme with note about v16 --- README.md | 6 +++++- assets/urlpicker-icon-128.png | Bin 0 -> 4869 bytes 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 assets/urlpicker-icon-128.png diff --git a/README.md b/README.md index 3cef18d..9450231 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # UrlPicker for Umbraco v7 # -![UrlPicker](assets/urlpicker-icon.png) +![UrlPicker](assets/urlpicker-icon-128.png) + +[![Build status](https://ci.appveyor.com/api/projects/status/k92sy9ea8oak14n6?svg=true)](https://ci.appveyor.com/project/JeavonLeopold/uwestfest-x4mvd) Originally built during uWestFest 2014 and released on NuGet only. Now available to non-Nugeteers. @@ -8,6 +10,8 @@ Authored by Tom Fulton, Kevin Giszewski, Jeavon Leopold, Bjarne Fyrstenborg and If using v0.15.x+ with Umbraco Core 7.2.8 and lower, please note you will need to merge translation keys manually into the language file of choice. +v0.16.0 contains an (un)breaking change as the value converter will now return either a `UrlPicker` object or a `IEnumerable` depending on if the developer has set UrlPicker to multiple mode in the data type prevalues + ## Installation ## Both NuGet and Umbraco packages are available. diff --git a/assets/urlpicker-icon-128.png b/assets/urlpicker-icon-128.png new file mode 100644 index 0000000000000000000000000000000000000000..6abbb58f33ecb436779bb43be555f20f856216d6 GIT binary patch literal 4869 zcmb_gX*iT^*nWnwB^qn8WFI0+b{YE?*^0y{ge0P7EHTKS7-WfT*+wdP(PWwITWFFO zd97iRbwot={k!|~{rY}>&v87@bIfzkao^W{UDtV@*LBC)Sede&;6DLD5S!U0qpRSJ z|9dktf@izVt#0sw`x}_qF@r0N*@FOnvpl%u=np}xoPTfFf7C|@;GleVr|5UMFgXIQ^# zNrjmVe1wZ&vLFd|E_}x=x)coyh%=T&Z(0#{Ne~Iewf}z%J_}WT_3Bl?_m+s`b;u)e zRM@1wjb6IDy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ZEzJ`?@wZ%{^+vSl*q6p;vk>nh&Mto&sS{nJMuPgZApCd{goFjq3g|B$g9^vJ zFJIfL=Dix} Date: Wed, 3 Aug 2016 10:22:44 +0100 Subject: [PATCH 2/6] Bump the version to 0.16.1 for next builds and set AssemblyInfo.cs and meta.json to 1.0.0.0 as this will now be taken care of by AppVeyor from appveyor.yml --- appveyor.yml | 2 +- urlpicker/config/meta.json | 2 +- urlpicker/src/UrlPicker.Umbraco/Properties/AssemblyInfo.cs | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 5fcc186..fa26199 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 0.16.0.{build} +version: 0.16.1.{build} os: Visual Studio 2015 cache: diff --git a/urlpicker/config/meta.json b/urlpicker/config/meta.json index f449a6b..c02dcae 100644 --- a/urlpicker/config/meta.json +++ b/urlpicker/config/meta.json @@ -1,6 +1,6 @@ { "name": "UrlPicker", - "version": "0.15.0.1", + "version": "1.0.0.0", "url": "https://github.com/imulus/uWestFest", "author": "Imulus - Kevin Giszewski - Tom Fulton - Jeavon Leopold - Bjarne Fyrstenborg, Et. Al.", "authorUrl": "http://imulus.com/", diff --git a/urlpicker/src/UrlPicker.Umbraco/Properties/AssemblyInfo.cs b/urlpicker/src/UrlPicker.Umbraco/Properties/AssemblyInfo.cs index 40b2124..66ce536 100644 --- a/urlpicker/src/UrlPicker.Umbraco/Properties/AssemblyInfo.cs +++ b/urlpicker/src/UrlPicker.Umbraco/Properties/AssemblyInfo.cs @@ -32,5 +32,6 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.13.0.0")] -[assembly: AssemblyFileVersion("0.15.0.1")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyInformationalVersion("1.0.0.0")] \ No newline at end of file From 42ba61d5bc0f0e1a243ad59697bf7e0aaee67c6f Mon Sep 17 00:00:00 2001 From: Jeavon Date: Wed, 3 Aug 2016 12:47:51 +0100 Subject: [PATCH 3/6] Add ignore rule for VS2015 hidden folder --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 1bb174e..f667f4e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +#VS 2015 hidden folder +**/.vs/* + .DS_Store .AppleDouble .LSOverride From 26382917339e4609b7eb19d0b1ec640a2a528954 Mon Sep 17 00:00:00 2001 From: Jeavon Date: Wed, 24 Aug 2016 10:26:28 +0100 Subject: [PATCH 4/6] Add link to Readme for Wiki --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9450231..73c811b 100644 --- a/README.md +++ b/README.md @@ -24,4 +24,8 @@ Both NuGet and Umbraco packages are available. |Umbraco Packages | | |:-----------------|:-----------------| |**Release**|[![Our Umbraco project page](https://img.shields.io/badge/our-umbraco-orange.svg)](https://our.umbraco.org/projects/backoffice-extensions/urlpicker/) -|**Pre-release**| [![AppVeyor Artifacts](https://img.shields.io/badge/appveyor-umbraco-orange.svg)](https://ci.appveyor.com/project/JeavonLeopold/uwestfest-x4mvd/build/artifacts) \ No newline at end of file +|**Pre-release**| [![AppVeyor Artifacts](https://img.shields.io/badge/appveyor-umbraco-orange.svg)](https://ci.appveyor.com/project/JeavonLeopold/uwestfest-x4mvd/build/artifacts) + +## Usage ## + +Examples available in the [Wiki](https://github.com/kgiszewski/uWestFest/wiki/Usage) \ No newline at end of file From 6dca20e30ce574ee2c652f002c3d63e2b5ae73bf Mon Sep 17 00:00:00 2001 From: Jeavon Date: Wed, 12 Oct 2016 11:44:15 +0100 Subject: [PATCH 5/6] Fix for #46 - Upgrading from 0.14 r to 0.15+ causes data corruption --- urlpicker/app/scripts/controllers/url.picker.controller.js | 7 +++++++ .../PropertyConverters/UrlPickerValueConverter.cs | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/urlpicker/app/scripts/controllers/url.picker.controller.js b/urlpicker/app/scripts/controllers/url.picker.controller.js index 10ad771..7991512 100644 --- a/urlpicker/app/scripts/controllers/url.picker.controller.js +++ b/urlpicker/app/scripts/controllers/url.picker.controller.js @@ -348,6 +348,13 @@ angular.module('umbraco').controller('UrlPickerController', function ($scope, $t // Setup "render model" & defaults function init() { + // hack to update v0.14 or lower version items to new format + var stringValue = JSON.stringify($scope.model.value); + if (stringValue.substring(0, 1) === '{') { + var newStringValue = "[" + JSON.stringify($scope.model.value) + "]"; + $scope.model.value = newStringValue; + } + // content start node if (!$scope.model.config.contentStartNode) $scope.model.config.contentStartNode = -1; diff --git a/urlpicker/src/UrlPicker.Umbraco/PropertyConverters/UrlPickerValueConverter.cs b/urlpicker/src/UrlPicker.Umbraco/PropertyConverters/UrlPickerValueConverter.cs index 168f3a6..8db05d4 100644 --- a/urlpicker/src/UrlPicker.Umbraco/PropertyConverters/UrlPickerValueConverter.cs +++ b/urlpicker/src/UrlPicker.Umbraco/PropertyConverters/UrlPickerValueConverter.cs @@ -33,6 +33,12 @@ public override object ConvertSourceToObject(PublishedPropertyType propertyType, { try { + // hack to update v0.14 or lower version items to new format + if (sourceString.StartsWith("{")) + { + sourceString = string.Format("[{0}]", sourceString); + } + var pickers = JsonConvert.DeserializeObject>(sourceString); var helper = new UmbracoHelper(UmbracoContext.Current); From 1a5ed8df80f362c46b23c47f4a78b460e1901090 Mon Sep 17 00:00:00 2001 From: Jeavon Date: Fri, 14 Oct 2016 12:16:56 +0100 Subject: [PATCH 6/6] Added a try/catch to getting mutlipleItems prevalue to help with upgrades from earlier versions --- .../UrlPickerValueConverter.cs | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/urlpicker/src/UrlPicker.Umbraco/PropertyConverters/UrlPickerValueConverter.cs b/urlpicker/src/UrlPicker.Umbraco/PropertyConverters/UrlPickerValueConverter.cs index 8db05d4..06e37bd 100644 --- a/urlpicker/src/UrlPicker.Umbraco/PropertyConverters/UrlPickerValueConverter.cs +++ b/urlpicker/src/UrlPicker.Umbraco/PropertyConverters/UrlPickerValueConverter.cs @@ -157,20 +157,28 @@ private bool IsMultipleDataType(int dataTypeId) return (bool) cachedValue; } - var dts = ApplicationContext.Current.Services.DataTypeService; + var multipleItems = false; - var multiPickerPreValue = - dts.GetPreValuesCollectionByDataTypeId(dataTypeId) - .PreValuesAsDictionary.FirstOrDefault( - x => string.Equals(x.Key, "multipleItems", StringComparison.InvariantCultureIgnoreCase)).Value; + try + { + var dts = ApplicationContext.Current.Services.DataTypeService; - var multipleItems = false; + var multiPickerPreValue = + dts.GetPreValuesCollectionByDataTypeId(dataTypeId) + .PreValuesAsDictionary.FirstOrDefault( + x => string.Equals(x.Key, "multipleItems", StringComparison.InvariantCultureIgnoreCase)) + .Value; - var attemptConvert = multiPickerPreValue.Value.TryConvertTo(); + var attemptConvert = multiPickerPreValue.Value.TryConvertTo(); - if (attemptConvert.Success) + if (attemptConvert.Success) + { + multipleItems = attemptConvert.Result; + } + } + catch { - multipleItems = attemptConvert.Result; + LogHelper.Warn(typeof(UrlPickerValueConverter), string.Format("Error finding multipleItems data type prevalue, likely you've updated UrlPicker, plesae resave data type with id:{0}", dataTypeId)); } LocalCache.InsertLocalCacheItem(cacheKey, () => multipleItems);