Back to 10.2.0-ish

This commit is contained in:
Sebastiaan Janssen
2022-09-19 16:14:16 +02:00
parent 8de26c6098
commit 87c06f5f98
296 changed files with 4106 additions and 3401 deletions

View File

@@ -243,7 +243,7 @@ public class ContentCache : PublishedCacheBase, IPublishedContentCache, INavigab
IPublishedContent? rootNode = GetByRoute(preview, "/", true);
if (rootNode == null)
{
throw new Exception("Failed to get node at /. This might be because you're trying to publish a variant, with no domains setup");
throw new Exception("Failed to get node at /.");
}
// remove only if we're the default node

View File

@@ -1,18 +1,22 @@
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.PublishedCache;
using Umbraco.Cms.Infrastructure.PublishedCache.DataSource;
namespace Umbraco.Cms.Infrastructure.PublishedCache;
public struct ContentNodeKit
{
public ContentNode Node { get; } = null!;
public struct ContentNodeKit
{
[Obsolete("This will be changed to a property in future versions")]
public ContentNode Node = null!;
public int ContentTypeId { get; }
[Obsolete("This will be changed to a property in future versions")]
public int ContentTypeId;
public ContentData? DraftData { get; }
[Obsolete("This will be changed to a property in future versions")]
public ContentData? DraftData;
public ContentData? PublishedData { get; }
[Obsolete("This will be changed to a property in future versions")]
public ContentData? PublishedData;
public ContentNodeKit(ContentNode node, int contentTypeId, ContentData? draftData, ContentData? publishedData)
{

View File

@@ -1,11 +1,30 @@
namespace Umbraco.Cms.Infrastructure.PublishedCache.DataSource;
namespace Umbraco.Cms.Infrastructure.PublishedCache.DataSource;
/// <summary>
/// Represents everything that is specific to an edited or published content version
/// Represents everything that is specific to an edited or published content version
/// </summary>
public class ContentData
{
public ContentData(string? name, string? urlSegment, int versionId, DateTime versionDate, int writerId, int? templateId, bool published, IDictionary<string, PropertyData[]>? properties, IReadOnlyDictionary<string, CultureVariation>? cultureInfos)
// Scheduled for removal in V11
[Obsolete("Use ctor with all params, as the pros should be immutable")]
public ContentData()
{
Name = string.Empty;
UrlSegment = string.Empty;
Properties = null!;
CultureInfos = null!;
}
public ContentData(
string? name,
string? urlSegment,
int versionId,
DateTime versionDate,
int writerId,
int? templateId,
bool published,
IDictionary<string, PropertyData[]>? properties,
IReadOnlyDictionary<string, CultureVariation>? cultureInfos)
{
Name = name ?? throw new ArgumentNullException(nameof(name));
UrlSegment = urlSegment;
@@ -18,19 +37,69 @@ public class ContentData
CultureInfos = cultureInfos;
}
public string Name { get; }
public string? UrlSegment { get; }
public int VersionId { get; }
public DateTime VersionDate { get; }
public int WriterId { get; }
public int? TemplateId { get; }
public bool Published { get; }
public string Name
{
get;
[Obsolete("Do not change this, use ctor with params and have this object immutable.")]
set;
}
public IDictionary<string, PropertyData[]> Properties { get; }
public string? UrlSegment
{
get;
[Obsolete("Do not change this, use ctor with params and have this object immutable.")]
set;
}
public int VersionId
{
get;
[Obsolete("Do not change this, use ctor with params and have this object immutable.")]
set;
}
public DateTime VersionDate
{
get;
[Obsolete("Do not change this, use ctor with params and have this object immutable.")]
set;
}
public int WriterId
{
get;
[Obsolete("Do not change this, use ctor with params and have this object immutable.")]
set;
}
public int? TemplateId
{
get;
[Obsolete("Do not change this, use ctor with params and have this object immutable.")]
set;
}
public bool Published
{
get;
[Obsolete("Do not change this, use ctor with params and have this object immutable.")]
set;
}
public IDictionary<string, PropertyData[]> Properties
{
get;
[Obsolete("Do not change this, use ctor with params and have this object immutable.")]
set;
}
/// <summary>
/// The collection of language Id to name for the content item
/// The collection of language Id to name for the content item
/// </summary>
public IReadOnlyDictionary<string, CultureVariation>? CultureInfos { get; }
public IReadOnlyDictionary<string, CultureVariation>? CultureInfos
{
get;
[Obsolete("Do not change this, use ctor with params and have this object immutable.")]
set;
}
}

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Umbraco.Cms.Infrastructure.PublishedCache</RootNamespace>
<PackageId>Umbraco.Cms.PublishedCache.NuCache</PackageId>
<Title>Umbraco CMS Published Cache</Title>
@@ -18,7 +18,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="MessagePack" Version="2.4.35" />
<PackageReference Include="MessagePack" Version="2.3.85" />
<PackageReference Include="K4os.Compression.LZ4" Version="1.2.16" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Umbraco.Code" Version="2.0.0">