diff --git a/Directory.Packages.props b/Directory.Packages.props index dd3d247e..2eb384ad 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -8,6 +8,7 @@ + diff --git a/uSync.BackOffice/HealthChecks/SyncFolderIntegrityChecks.cs b/uSync.BackOffice/HealthChecks/SyncFolderIntegrityChecks.cs index c440942f..866e292b 100644 --- a/uSync.BackOffice/HealthChecks/SyncFolderIntegrityChecks.cs +++ b/uSync.BackOffice/HealthChecks/SyncFolderIntegrityChecks.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Linq; using System.Threading.Tasks; using System.Xml.Linq; @@ -23,7 +24,6 @@ public class SyncFolderIntegrityChecks : HealthCheck private readonly ISyncConfigService? _configService; private readonly ISyncFileService? _fileService; - public SyncFolderIntegrityChecks() { } /// @@ -44,17 +44,8 @@ public override HealthCheckStatus ExecuteAction(HealthCheckAction action) /// public override Task> GetStatusAsync() { - if (_configService is null || _fileService is null) - { - return Task.FromResult((IEnumerable)new List - { - new HealthCheckStatus("uSync services not available") - { - Description = "The uSync services are not available, this likely means the site has no backoffice loaded.", - ResultType = StatusResultType.Info - } - }); - } + if (_configService is null || _fileService is null) + return Task.FromResult(Enumerable.Empty()); var items = new List { @@ -67,6 +58,9 @@ public override Task> GetStatusAsync() private HealthCheckStatus CheckuSyncFolder() { + if (_configService is null || _fileService is null) + return new HealthCheckStatus("Unable to check uSync folder integrity"); + var root = _fileService.GetAbsPath(_configService.GetWorkingFolder()); if (_fileService.DirectoryExists(root) is false) @@ -100,6 +94,8 @@ private HealthCheckStatus CheckuSyncFolder() private List CheckFolder(string folder) { + if (_fileService is null) return []; + var _keys = new Dictionary(); var clashes = new List(); @@ -143,6 +139,9 @@ private List CheckFolder(string folder) private HealthCheckStatus CheckConfigFolderValidity() { + if (_configService is null || _fileService is null) + return new HealthCheckStatus("Unable to check uSync folder integrity"); + var root = _fileService.GetAbsPath(_configService.GetWorkingFolder()); if (_fileService.DirectoryExists(root) is false) diff --git a/uSync.Backoffice.Management.Client/usync-assets/package-lock.json b/uSync.Backoffice.Management.Client/usync-assets/package-lock.json index a0c082e7..fafc88bb 100644 --- a/uSync.Backoffice.Management.Client/usync-assets/package-lock.json +++ b/uSync.Backoffice.Management.Client/usync-assets/package-lock.json @@ -1,12 +1,12 @@ { "name": "@jumoo/usync", - "version": "17.3.3", + "version": "17.3.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@jumoo/usync", - "version": "17.3.3", + "version": "17.3.4", "license": "MPL-2.0", "devDependencies": { "@hey-api/openapi-ts": "^0.95.0", diff --git a/uSync.Backoffice.Management.Client/usync-assets/package.json b/uSync.Backoffice.Management.Client/usync-assets/package.json index 82b5cbd2..a09d7e7e 100644 --- a/uSync.Backoffice.Management.Client/usync-assets/package.json +++ b/uSync.Backoffice.Management.Client/usync-assets/package.json @@ -8,7 +8,7 @@ "homepage": "https://jumoo.co.uk/uSync", "license": "MPL-2.0", "type": "module", - "version": "17.3.3", + "version": "17.3.4", "main": "./dist/usync.js", "types": "./dist/index.d.ts", "module": "./dist/usync.js", diff --git a/uSync.Core/Mapping/SyncBlockMapperBase.cs b/uSync.Core/Mapping/SyncBlockMapperBase.cs index 267d288e..92218a53 100644 --- a/uSync.Core/Mapping/SyncBlockMapperBase.cs +++ b/uSync.Core/Mapping/SyncBlockMapperBase.cs @@ -62,18 +62,11 @@ public SyncBlockMapperBase( _logger.LogDebug("Importing block value for {PropertyEditorAlias} {valueType}", propertyType.PropertyEditorAlias, value?.GetType().Name ?? "blank"); var importString = SyncBlockMapperBase.GetStringValue(value) ?? string.Empty; - var result = await _mapperCollection.Value.GetImportValueAsync(importString, propertyType, options); - // When the original value was a non-string JSON type (array, object, number, etc.), - // convert string results back to JsonNode to preserve the correct JSON type - // and prevent double-encoding when the block value is re-serialized. - if (result is string stringResult && value.IsNonStringJsonValue()) - { - return stringResult.ConvertStringToExpandedJson() ?? result; - // return stringResult.ConvertToJsonNode() ?? result; - } - - return result; + // revert this back to the old way - we don't expand the json we get back because umbraco is very + // sensitve to what the exact format of the blocks is, and if we expand them, then calls during render + // can return null. + return await _mapperCollection.Value.GetImportValueAsync(importString, propertyType, options); } private async Task GetExportProperty(object? value, IPropertyType? propertyType, SyncSerializerOptions options) diff --git a/uSync.History/history-client/package-lock.json b/uSync.History/history-client/package-lock.json index 426fb256..c0b6f51a 100644 --- a/uSync.History/history-client/package-lock.json +++ b/uSync.History/history-client/package-lock.json @@ -1,12 +1,12 @@ { "name": "usync-history-client", - "version": "17.3.3", + "version": "17.3.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "usync-history-client", - "version": "17.3.3", + "version": "17.3.4", "devDependencies": { "@hey-api/openapi-ts": "^0.95.0", "@jumoo/translate": "^17.2.3", diff --git a/uSync.History/history-client/package.json b/uSync.History/history-client/package.json index 9696c20e..7d491ab4 100644 --- a/uSync.History/history-client/package.json +++ b/uSync.History/history-client/package.json @@ -1,6 +1,6 @@ { "name": "usync-history-client", - "version": "17.3.3", + "version": "17.3.4", "licence": "Custom", "description": "uSync history function", "type": "module",