Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

(#957) fix tokenization for FooterLinks #976

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
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 @@ -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
Loading