|
6 | 6 | using Our.Umbraco.DocTypeGridEditor.Extensions;
|
7 | 7 | using Our.Umbraco.DocTypeGridEditor.Models;
|
8 | 8 | using Umbraco.Core;
|
| 9 | +using Umbraco.Core.Logging; |
9 | 10 | using Umbraco.Core.Models;
|
10 | 11 | using Umbraco.Core.Models.Editors;
|
11 | 12 | using Umbraco.Core.Models.PublishedContent;
|
@@ -78,10 +79,30 @@ private static IPublishedContent ConvertValue(string id, string contentTypeAlias
|
78 | 79 | * XML serialized state as expected by the published property by calling ConvertDbToString
|
79 | 80 | */
|
80 | 81 | var propType2 = contentType.CompositionPropertyTypes.Single(x => x.Alias == propType.PropertyTypeAlias);
|
81 |
| - var newValue2 = propEditor.ValueEditor.ConvertDbToString(new Property(propType2, newValue), propType2, |
82 |
| - ApplicationContext.Current.Services.DataTypeService); |
83 | 82 |
|
84 |
| - properties.Add(new DetachedPublishedProperty(propType, newValue2)); |
| 83 | + Property prop2 = null; |
| 84 | + try |
| 85 | + { |
| 86 | + /* HACK: [LK:2016-04-01] When using the "Umbraco.Tags" property-editor, the converted DB value does |
| 87 | + * not match the datatypes underlying db-column type. So it throws a "Type validation failed" exception. |
| 88 | + * We feel that the Umbraco core isn't handling the Tags value correctly, as it should be the responsiblity |
| 89 | + * of the "Umbraco.Tags" property-editor to handle the value conversion into the correct type. |
| 90 | + * See: http://issues.umbraco.org/issue/U4-8279 |
| 91 | + */ |
| 92 | + prop2 = new Property(propType2, newValue); |
| 93 | + } |
| 94 | + catch(Exception ex) |
| 95 | + { |
| 96 | + LogHelper.Error<DocTypeGridEditorHelper>("Error creating Property object.", ex); |
| 97 | + } |
| 98 | + |
| 99 | + if (prop2 != null) |
| 100 | + { |
| 101 | + var newValue2 = propEditor.ValueEditor.ConvertDbToString(prop2, propType2, |
| 102 | + ApplicationContext.Current.Services.DataTypeService); |
| 103 | + |
| 104 | + properties.Add(new DetachedPublishedProperty(propType, newValue2)); |
| 105 | + } |
85 | 106 | }
|
86 | 107 | }
|
87 | 108 |
|
|
0 commit comments