Skip to content

Commit

Permalink
Merge branch 'Feature386904_PageValidationChange_V4' of https://githu…
Browse files Browse the repository at this point in the history
  • Loading branch information
jansenbe committed Jan 16, 2025
2 parents a1e7736 + 1b67b2e commit 40543c4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/sdk/PnP.Core/Model/SharePoint/Pages/Internal/Page.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1452,10 +1452,10 @@ private void LoadFromHtml(string html, string pageHeaderHtml)
// Reindex the control order. We're starting control order from 1 for each column.
ReIndex();

var hasPageTitleWPInOneColumFullWith = false;
if (sections.Any(s => s.Type == CanvasSectionTemplate.OneColumnFullWidth && s.Controls.Any(c => (c as PageWebPart)?.WebPartId?.Equals("cbe7b0a9-3504-44dd-a3a3-0e5cacd07788") == true)))
var hasPageTitleWepPart = false;
if (sections.Any(s => s.Controls.Any(c => (c as PageWebPart)?.WebPartId?.Equals("cbe7b0a9-3504-44dd-a3a3-0e5cacd07788") == true)))
{
hasPageTitleWPInOneColumFullWith = true; //Message ID: MC791596 / Roadmap ID: 386904
hasPageTitleWepPart = true; //Message ID: MC791596 / Roadmap ID: 386904
}

// Load page header controls. Microsoft Syntex Topic pages do have 5 controls in the header (= controls that cannot be moved)
Expand Down Expand Up @@ -1486,7 +1486,7 @@ private void LoadFromHtml(string html, string pageHeaderHtml)
}
else
{
if (hasPageTitleWPInOneColumFullWith)
if (hasPageTitleWepPart)
{
pageHeader = new PageHeader(PnPContext, PageHeaderType.PageTitleWebPart, null);
}
Expand Down Expand Up @@ -1677,7 +1677,7 @@ public async Task<string> SaveAsync(string pageName = null)
var pageHeaderHtml = "";
if (pageHeader != null)
{
if(pageHeader.Type == PageHeaderType.Default && sections.Any(s => s.Type == CanvasSectionTemplate.OneColumnFullWidth && s.Controls.Any(c => (c as PageWebPart)?.WebPartId?.Equals("cbe7b0a9-3504-44dd-a3a3-0e5cacd07788") == true)))
if(pageHeader.Type == PageHeaderType.Default && sections.Any(s => s.Controls.Any(c => (c as PageWebPart)?.WebPartId?.Equals("cbe7b0a9-3504-44dd-a3a3-0e5cacd07788") == true)))
{
//Page created from code and Header was not set
SetPageTitleWebPartPageHeader();
Expand Down

0 comments on commit 40543c4

Please sign in to comment.