|
5 | 5 | using Newtonsoft.Json.Linq;
|
6 | 6 | using Umbraco.Core;
|
7 | 7 | using Umbraco.Core.Deploy;
|
| 8 | +using Umbraco.Core.Logging; |
8 | 9 | using Umbraco.Core.Models;
|
9 | 10 | using Umbraco.Core.Services;
|
10 | 11 | using Umbraco.Deploy.ValueConnectors;
|
@@ -64,6 +65,13 @@ public string GetValue(Property property, ICollection<ArtifactDependency> depend
|
64 | 65 | if (vortoValue?.Values?.ValuePairs == null)
|
65 | 66 | return null;
|
66 | 67 |
|
| 68 | + // old versions of Vorto doesn't seem to store a DtdGuid - in those cases we just deploy the value as it is without any further handling. |
| 69 | + if (string.IsNullOrWhiteSpace(vortoValue.DtdGuid)) |
| 70 | + { |
| 71 | + LogHelper.Debug<VortoValueConnector>($"No datatype definition defined inside the Vorto property: {property.Alias} - are you using an old version of Vorto? - data value will be deployed as it is."); |
| 72 | + return value; |
| 73 | + } |
| 74 | + |
67 | 75 | // get the Vorto datatype
|
68 | 76 | var vortoDataType = _dataTypeService.GetDataTypeDefinitionById(Guid.Parse(vortoValue.DtdGuid));
|
69 | 77 |
|
@@ -135,6 +143,14 @@ public void SetValue(IContentBase content, string alias, string value)
|
135 | 143 | if (vortoValue == null)
|
136 | 144 | return;
|
137 | 145 |
|
| 146 | + // old versions of Vorto doesn't seem to store a DtdGuid - in those cases we just deploy the value as it is without any further handling. |
| 147 | + if (string.IsNullOrWhiteSpace(vortoValue.DtdGuid)) |
| 148 | + { |
| 149 | + LogHelper.Debug<VortoValueConnector>($"No datatype definition defined inside the Vorto property: {alias} - are you using an old version of Vorto? - data value will be deployed as it is."); |
| 150 | + content.SetValue(alias, value); |
| 151 | + return; |
| 152 | + } |
| 153 | + |
138 | 154 | // getting the wrapped datatype via the Vorto datatype
|
139 | 155 | var vortoDataType = _dataTypeService.GetDataTypeDefinitionById(Guid.Parse(vortoValue.DtdGuid));
|
140 | 156 | var vortoDataTypePrevalueJson = _dataTypeService.GetPreValuesCollectionByDataTypeId(vortoDataType.Id).FormatAsDictionary().FirstOrDefault(x => x.Key == "dataType").Value.Value;
|
|
0 commit comments