Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

GetWebSearchCenterUrl makes us loose the pending changes in CSOM Context #454

Merged
merged 1 commit into from
Sep 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -391,13 +391,6 @@ public override TokenParser ProvisionObjects(Web web, ProvisioningTemplate templ
web.SearchBoxInNavBar = (SearchBoxInNavBarType)Enum.Parse(typeof(SearchBoxInNavBarType), webSettings.SearchBoxInNavBar.ToString(), true);
}

string searchCenterUrl = parser.ParseString(webSettings.SearchCenterUrl);
if (!string.IsNullOrEmpty(searchCenterUrl) &&
web.GetWebSearchCenterUrl(true) != searchCenterUrl)
{
web.SetWebSearchCenterUrl(searchCenterUrl);
}

var masterUrl = parser.ParseString(webSettings.MasterPageUrl);
if (!string.IsNullOrEmpty(masterUrl))
{
Expand Down Expand Up @@ -510,6 +503,14 @@ public override TokenParser ProvisionObjects(Web web, ProvisioningTemplate templ
web.Update();
web.Context.ExecuteQueryRetry();

//GetWebSearchCenterUrl makes us loose the pending changes in CSOM Context
string searchCenterUrl = parser.ParseString(webSettings.SearchCenterUrl);
if (!string.IsNullOrEmpty(searchCenterUrl) &&
web.GetWebSearchCenterUrl(true) != searchCenterUrl)
{
web.SetWebSearchCenterUrl(searchCenterUrl);
}

if (webSettings.HubSiteUrl != null)
{
if (TenantExtensions.IsCurrentUserTenantAdmin(web.Context as ClientContext))
Expand Down