Merge remote-tracking branch 'origin/v8/8.16' into v9/dev

# Conflicts:
#	build/NuSpecs/UmbracoCms.Core.nuspec
#	build/NuSpecs/UmbracoCms.nuspec
#	build/build.ps1
#	src/SolutionInfo.cs
#	src/Umbraco.Core/Diagnostics/MiniDump.cs
#	src/Umbraco.Core/Sync/DatabaseServerMessenger.cs
#	src/Umbraco.Infrastructure/Persistence/LocalDb.cs
#	src/Umbraco.Infrastructure/PropertyEditors/BlockEditorPropertyHandler.cs
#	src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs
This commit is contained in:
Bjarke Berg
2021-08-26 12:13:04 +02:00
9 changed files with 68 additions and 16 deletions

View File

@@ -0,0 +1,29 @@
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<runtime xdt:Transform="InsertIfMissing" />
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" xdt:Transform="InsertIfMissing" />
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='System.Collections.Immutable')" xdt:Transform="Remove" />
<dependentAssembly xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='System.Buffers')" xdt:Transform="Remove" />
<dependentAssembly xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='System.Memory')" xdt:Transform="Remove" />
<dependentAssembly xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='System.Numerics.Vectors')" xdt:Transform="Remove" />
<dependentAssembly xdt:Transform="Insert">
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.2.5.0" newVersion="1.2.5.0" />
</dependentAssembly>
<dependentAssembly xdt:Transform="Insert">
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" />
<bindingRedirect oldVersion="4.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly xdt:Transform="Insert">
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" />
<bindingRedirect oldVersion="4.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
</dependentAssembly>
<dependentAssembly xdt:Transform="Insert">
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" />
<bindingRedirect oldVersion="4.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -92,6 +92,7 @@
$src = "$($this.SolutionRoot)\src"
$log = "$($this.BuildTemp)\belle.log"
Write-Host "Compile Belle"
Write-Host "Logging to $log"
@@ -555,7 +556,6 @@
# run
if (-not $get)
{
cd
if ($command.Length -eq 0)
{
$command = @( "Build" )

View File

@@ -21,7 +21,6 @@ namespace Umbraco.Cms.Core.PropertyEditors
public class DataEditor : IDataEditor
{
private IDictionary<string, object> _defaultConfiguration;
private IDataValueEditor _reusableEditor;
/// <summary>
/// Initializes a new instance of the <see cref="DataEditor"/> class.
@@ -90,8 +89,7 @@ namespace Umbraco.Cms.Core.PropertyEditors
/// simple enough for now.</para>
/// </remarks>
// TODO: point of that one? shouldn't we always configure?
public IDataValueEditor GetValueEditor() => ExplicitValueEditor ?? (_reusableEditor ?? (_reusableEditor = CreateValueEditor()));
public IDataValueEditor GetValueEditor() => ExplicitValueEditor ?? CreateValueEditor();
/// <inheritdoc />
/// <remarks>

View File

@@ -927,6 +927,7 @@ namespace Umbraco.Cms.Infrastructure.Persistence
return p.ExitCode;
}
}
/// <summary>

View File

@@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Umbraco.Cms.Core.Models.Blocks;
@@ -17,6 +18,12 @@ namespace Umbraco.Cms.Core.PropertyEditors
public class BlockEditorPropertyHandler : ComplexPropertyEditorContentNotificationHandler
{
private readonly BlockListEditorDataConverter _converter = new BlockListEditorDataConverter();
private readonly ILogger _logger;
public BlockEditorPropertyHandler(ILogger<BlockEditorPropertyHandler> logger)
{
_logger = logger;
}
protected override string EditorAlias => Constants.PropertyEditors.Aliases.BlockList;
@@ -110,8 +117,22 @@ namespace Umbraco.Cms.Core.PropertyEditors
// this gets a little ugly because there could be some other complex editor that contains another block editor
// and since we would have no idea how to parse that, all we can do is try JSON Path to find another block editor
// of our type
var json = JToken.Parse(asString);
if (ProcessJToken(json, createGuid, out var result))
JToken json = null;
try
{
json = JToken.Parse(asString);
}
catch (Exception e)
{
// See issue https://github.com/umbraco/Umbraco-CMS/issues/10879
// We are detecting JSON data by seeing if a string is surrounded by [] or {}
// If people enter text like [PLACEHOLDER] JToken parsing fails, it's safe to ignore though
// Logging this just in case in the future we find values that are not safe to ignore
_logger.LogWarning( "The property {PropertyAlias} on content type {ContentTypeKey} has a value of: {BlockItemValue} - this was recognized as JSON but could not be parsed",
data.Key, propertyAliasToBlockItemData.Key, asString);
}
if (json != null && ProcessJToken(json, createGuid, out var result))
{
// need to re-save this back to the RawPropertyValues
data.RawPropertyValues[propertyAliasToBlockItemData.Key] = result;

View File

@@ -4,6 +4,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Extensions.Logging;
using Moq;
using Newtonsoft.Json;
using NUnit.Framework;
using Umbraco.Cms.Core;
@@ -28,11 +30,15 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.PropertyEditors
private const string SubContentGuid1 = "4c44ce6b3a5c4f5f8f15e3dc24819a9e";
private const string SubContentGuid2 = "a062c06d6b0b44ac892b35d90309c7f8";
private const string SubSettingsGuid1 = "4d998d980ffa4eee8afdc23c4abd6d29";
private static readonly ILogger<BlockEditorPropertyHandler> s_logger = Mock.Of<ILogger<BlockEditorPropertyHandler>>();
[Test]
public void Cannot_Have_Null_Udi()
{
var component = new BlockEditorPropertyHandler();
var component = new BlockEditorPropertyHandler(s_logger);
var json = GetBlockListJson(null, string.Empty);
Assert.Throws<FormatException>(() => component.ReplaceBlockListUdis(json));
}
@@ -48,7 +54,7 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.PropertyEditors
var expected = ReplaceGuids(json, guids, ContentGuid1, ContentGuid2, SettingsGuid1);
var component = new BlockEditorPropertyHandler();
var component = new BlockEditorPropertyHandler(s_logger);
var result = component.ReplaceBlockListUdis(json, GuidFactory);
var expectedJson = JsonConvert.SerializeObject(JsonConvert.DeserializeObject(expected, _serializerSettings), _serializerSettings);
@@ -75,7 +81,7 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.PropertyEditors
// get the json with the subFeatures as escaped
var json = GetBlockListJson(innerJsonEscaped);
var component = new BlockEditorPropertyHandler();
var component = new BlockEditorPropertyHandler(s_logger);
var result = component.ReplaceBlockListUdis(json, GuidFactory);
// the expected result is that the subFeatures data is no longer escaped
@@ -119,7 +125,7 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.PropertyEditors
SubContentGuid2,
SubSettingsGuid1);
var component = new BlockEditorPropertyHandler();
var component = new BlockEditorPropertyHandler(s_logger);
var result = component.ReplaceBlockListUdis(json, GuidFactory);
var expectedJson = JsonConvert.SerializeObject(JsonConvert.DeserializeObject(expected, _serializerSettings), _serializerSettings);
@@ -147,7 +153,7 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.PropertyEditors
var json = GetBlockListJson(complexEditorJsonEscaped);
var component = new BlockEditorPropertyHandler();
var component = new BlockEditorPropertyHandler(s_logger);
var result = component.ReplaceBlockListUdis(json, GuidFactory);
// the expected result is that the subFeatures data is no longer escaped

View File

@@ -3,7 +3,7 @@
* @name umbraco.directives.directive:umbTree
* @restrict E
**/
function umbTreeDirective($q, treeService, navigationService, notificationsService) {
function umbTreeDirective($q, treeService, notificationsService) {
return {
restrict: 'E',
@@ -357,8 +357,6 @@ function umbTreeDirective($q, treeService, navigationService, notificationsServi
defined on the tree
*/
$scope.select = function (n, ev) {
navigationService.hideMenu();
if (n.metaData && n.metaData.noAccess === true) {
ev.preventDefault();

View File

@@ -127,7 +127,7 @@ function navigationService($routeParams, $location, $q, $injector, eventsService
var aboveClass = "above-backdrop";
var leftColumn = document.getElementById("leftcolumn");
if(leftColumn) {
if (leftColumn) {
var isLeftColumnOnTop = leftColumn.classList.contains(aboveClass);
if (isLeftColumnOnTop) {

View File

@@ -585,7 +585,6 @@
display: inline-block;
position: relative;
vertical-align: top;
flex:0;
}
.umb-fileupload,