Merge remote-tracking branch 'origin/v12/dev' into v13/dev
This commit is contained in:
@@ -1223,8 +1223,11 @@ AND umbracoNode.id <> @id",
|
||||
/// If this is not done, then in some cases the "edited" value for a particular culture for a document will remain true
|
||||
/// when it should be false
|
||||
/// if the property was changed to invariant. In order to do this we need to recalculate this value based on the values
|
||||
/// stored for each
|
||||
/// property, culture and current/published version.
|
||||
/// stored for each property, culture and current/published version.
|
||||
///
|
||||
/// Some of the sql statements in this function have a tendency to take a lot of parameters (nodeIds)
|
||||
/// as the WhereIn Npoco method translates all the nodeIds being passed in as parameters when using the SqlClient provider.
|
||||
/// this results in to many parameters (>2100) error => We need to batch the calls
|
||||
/// </remarks>
|
||||
private void RenormalizeDocumentEditedFlags(
|
||||
IReadOnlyCollection<int> propertyTypeIds,
|
||||
@@ -1379,17 +1382,20 @@ AND umbracoNode.id <> @id",
|
||||
|
||||
// Now bulk update the table DocumentCultureVariationDto, once for edited = true, another for edited = false
|
||||
foreach (IGrouping<bool, DocumentCultureVariationDto> editValue in toUpdate.GroupBy(x => x.Edited))
|
||||
{
|
||||
// update in batches to account for maximum parameter count
|
||||
foreach (IEnumerable<DocumentCultureVariationDto> batchedValues in editValue.InGroupsOf(Constants.Sql.MaxParameterCount))
|
||||
{
|
||||
Database.Execute(Sql().Update<DocumentCultureVariationDto>(u => u.Set(x => x.Edited, editValue.Key))
|
||||
.WhereIn<DocumentCultureVariationDto>(x => x.Id, editValue.Select(x => x.Id)));
|
||||
.WhereIn<DocumentCultureVariationDto>(x => x.Id, batchedValues.Select(x => x.Id)));
|
||||
}
|
||||
}
|
||||
|
||||
// Now bulk update the umbracoDocument table
|
||||
// we need to do this in batches as the WhereIn Npoco method translates to all the nodeIds being passed in as parameters when using the SqlClient provider
|
||||
// this results in to many parameters (>2100) being passed to the client when there are a lot of documents being normalized
|
||||
foreach (IGrouping<bool, KeyValuePair<int, bool>> groupByValue in editedDocument.GroupBy(x => x.Value))
|
||||
{
|
||||
foreach (IEnumerable<KeyValuePair<int, bool>> batch in groupByValue.InGroupsOf(2000))
|
||||
// update in batches to account for maximum parameter count
|
||||
foreach (IEnumerable<KeyValuePair<int, bool>> batch in groupByValue.InGroupsOf(Constants.Sql.MaxParameterCount))
|
||||
{
|
||||
Database.Execute(Sql().Update<DocumentDto>(u => u.Set(x => x.Edited, groupByValue.Key))
|
||||
.WhereIn<DocumentDto>(x => x.NodeId, batch.Select(x => x.Key)));
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Umbraco.JsonSchema.Extensions" PrivateAssets="all" />
|
||||
</ItemGroup>
|
||||
<Target Name="GetUpdatedTemplateJsonPackageFiles" BeforeTargets="GenerateNuspec" AfterTargets="GetBuildVersion;GetUmbracoBuildVersion">
|
||||
<ItemGroup>
|
||||
<Content Update="**\.template.config\template.json" Pack="false" />
|
||||
</ItemGroup>
|
||||
@@ -58,9 +59,12 @@
|
||||
<Copy SourceFiles="@(_TemplateJsonFiles)" DestinationFiles="%(DestinationFile)" />
|
||||
<JsonPathUpdateValue JsonFile="%(_TemplateJsonFiles.DestinationFile)" Path="$.symbols.UmbracoVersion.defaultValue" Value=""$(PackageVersion)"" />
|
||||
<ItemGroup>
|
||||
<_PackageFiles Include="%(_TemplateJsonFiles.DestinationFile)">
|
||||
<PackagePath>%(RelativeDir)</PackagePath>
|
||||
<_PackageFiles Include="%(_TemplateJsonFiles.DestinationFile)">
|
||||
<PackagePath>%(_TemplateJsonFiles.RelativeDir)</PackagePath>
|
||||
</_PackageFiles>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
</Project>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user