Skip to content

Commit

Permalink
(pnp#957) fix tokenization for FooterLinks
Browse files Browse the repository at this point in the history
  • Loading branch information
nils-a committed Feb 9, 2024
1 parent 4fe1501 commit 8f5950e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public override ProvisioningTemplate ExtractObjects(Web web, ProvisioningTemplat
{
using (var scope = new PnPMonitoredScope(this.Name))
{
web.Context.Load(web, w => w.AllProperties, w => w.ServerRelativeUrl);
web.Context.Load(web, w => w.AllProperties, w => w.Url);
web.Context.ExecuteQueryRetry();

var entries = new List<PropertyBagEntry>();
Expand All @@ -106,7 +106,7 @@ public override ProvisioningTemplate ExtractObjects(Web web, ProvisioningTemplat

foreach (PropertyBagEntry propbagEntry in template.PropertyBagEntries)
{
propbagEntry.Value = Tokenize(propbagEntry.Value, web.ServerRelativeUrl);
propbagEntry.Value = Tokenize(propbagEntry.Value, web.Url);
}
}
return template;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public override ProvisioningTemplate ExtractObjects(Web web, ProvisioningTemplat
{
if (!string.IsNullOrEmpty(titleNodeNodes[0].SimpleUrl))
{
footer.Logo = Tokenize(titleNodeNodes[0].SimpleUrl, web.ServerRelativeUrl);
footer.Logo = Tokenize(titleNodeNodes[0].SimpleUrl, web.Url);
}
if (!string.IsNullOrEmpty(titleNodeNodes[0].Title))
{
Expand All @@ -89,7 +89,7 @@ public override ProvisioningTemplate ExtractObjects(Web web, ProvisioningTemplat
var logoNode = menuState.Nodes.FirstOrDefault(n => n.Title == Constants.SITEFOOTER_LOGONODEKEY);
if (logoNode != null)
{
footer.Logo = Tokenize(logoNode.SimpleUrl, web.ServerRelativeUrl);
footer.Logo = Tokenize(logoNode.SimpleUrl, web.Url);
}
}
}
Expand All @@ -99,7 +99,7 @@ public override ProvisioningTemplate ExtractObjects(Web web, ProvisioningTemplat
{
foreach (var innerMenuNode in menuNodesNode.Nodes)
{
footer.FooterLinks.Add(ParseNodes(innerMenuNode, template, web.ServerRelativeUrl, creationInfo.PersistMultiLanguageResources, defaultCulture, menuNodesNode.Key, creationInfo));
footer.FooterLinks.Add(ParseNodes(innerMenuNode, template, web.Url, creationInfo.PersistMultiLanguageResources, defaultCulture, menuNodesNode.Key, creationInfo));
}
}
if (creationInfo.ExtractConfiguration != null && creationInfo.ExtractConfiguration.SiteFooter != null && creationInfo.ExtractConfiguration.SiteFooter.RemoveExistingNodes)
Expand Down Expand Up @@ -310,7 +310,7 @@ private void CopyStream(Stream source, Stream destination)
destination.Write(buffer, 0, bytesRead);
} while (bytesRead != 0);
}
private SiteFooterLink ParseNodes(MenuNode node, ProvisioningTemplate template, string webServerRelativeUrl, bool persistLanguage, CultureInfo currentCulture, string parentKey, ProvisioningTemplateCreationInformation creationInfo)
private SiteFooterLink ParseNodes(MenuNode node, ProvisioningTemplate template, string webUrl, bool persistLanguage, CultureInfo currentCulture, string parentKey, ProvisioningTemplateCreationInformation creationInfo)
{
var link = new SiteFooterLink();

Expand All @@ -326,14 +326,14 @@ private SiteFooterLink ParseNodes(MenuNode node, ProvisioningTemplate template,
link.DisplayName = node.Title;
}

link.Url = Tokenize(node.SimpleUrl, webServerRelativeUrl);
link.Url = Tokenize(node.SimpleUrl, webUrl);

if (node.Nodes.Count > 0)
{
link.FooterLinks = new SiteFooterLinkCollection(template);
foreach (var childNode in node.Nodes)
{
link.FooterLinks.Add(ParseNodes(childNode, template, webServerRelativeUrl, persistLanguage, currentCulture, node.Key, creationInfo));
link.FooterLinks.Add(ParseNodes(childNode, template, webUrl, persistLanguage, currentCulture, node.Key, creationInfo));
}
}
return link;
Expand Down

0 comments on commit 8f5950e

Please sign in to comment.