Merge branch 'v8/dev' into v8/contrib

This commit is contained in:
Sebastiaan Janssen
2021-08-06 14:10:23 +02:00
6 changed files with 21 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ namespace Umbraco.Core.Persistence.Dtos
internal class ContentTypeDto
{
public const string TableName = Constants.DatabaseSchema.Tables.ContentType;
private string _alias;
[Column("pk")]
[PrimaryKeyColumn(IdentitySeed = 700)]
@@ -21,7 +22,7 @@ namespace Umbraco.Core.Persistence.Dtos
[Column("alias")]
[NullSetting(NullSetting = NullSettings.Null)]
public string Alias { get; set; }
public string Alias { get => _alias; set => _alias = value == null ? null : string.Intern(value); }
[Column("icon")]
[Index(IndexTypes.NonClustered)]

View File

@@ -10,6 +10,8 @@ namespace Umbraco.Core.Persistence.Dtos
[ExplicitColumns]
internal class PropertyTypeDto
{
private string _alias;
[Column("id")]
[PrimaryKeyColumn(IdentitySeed = 100)]
public int Id { get; set; }
@@ -29,7 +31,7 @@ namespace Umbraco.Core.Persistence.Dtos
[Index(IndexTypes.NonClustered, Name = "IX_cmsPropertyTypeAlias")]
[Column("Alias")]
public string Alias { get; set; }
public string Alias { get => _alias; set => _alias = value == null ? null : string.Intern(value); }
[Column("Name")]
[NullSetting(NullSetting = NullSettings.Null)]

View File

@@ -14,6 +14,11 @@ namespace Umbraco.Core.PropertyEditors
//Only compress non published content that supports publishing and the property is text
return true;
}
if (propertyType.ValueStorageType == ValueStorageType.Integer && Umbraco.Core.Constants.PropertyEditors.Aliases.Boolean.Equals(dataEditor.Alias))
{
//Compress boolean values from int to bool
return true;
}
return false;
}
}

View File

@@ -52,6 +52,7 @@
</div>
<input type="hidden" name="modelValue" ng-model="vm.model.value" val-server="value" />
<input type="hidden" name="minCount" ng-model="vm.model.value" val-server="minCount" />
<input type="hidden" name="maxCount" ng-model="vm.model.value" val-server="maxCount" />

View File

@@ -11,6 +11,7 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource
/// </summary>
internal class DictionaryOfPropertyDataSerializer : SerializerBase, ISerializer<IDictionary<string, PropertyData[]>>, IDictionaryOfPropertyDataSerializer
{
private static readonly PropertyData[] Empty = Array.Empty<PropertyData>();
public IDictionary<string, PropertyData[]> ReadFrom(Stream stream)
{
// read properties count
@@ -25,6 +26,11 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource
// read values count
var vcount = PrimitiveSerializer.Int32.ReadFrom(stream);
if(vcount == 0)
{
dict[key] = Empty;
continue;
}
// create pdata and add to the dictionary
var pdatas = new PropertyData[vcount];

View File

@@ -101,6 +101,10 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource
{
property.Value = LZ4Pickler.Pickle(Encoding.UTF8.GetBytes((string)property.Value), LZ4Level.L00_FAST);
}
foreach (var property in propertyAliasToData.Value.Where(x => x.Value != null && x.Value is int intVal))
{
property.Value = Convert.ToBoolean((int)property.Value);
}
}
}
}