pnp / PnP-Sites-Core

Microsoft 365 Dev PnP Core component (.NET) targeted for increasing developer productivity with CSOM based solutions.
Other
415 stars 643 forks source link

Views: NewDocumentTemplates -> Url Attribute not Parsed on Provisioning #2356

Closed czullu closed 5 years ago

czullu commented 5 years ago

Category

[x] Bug [ ] Enhancement

Environment

[x] Office 365 / SharePoint Online [ ] SharePoint 2016 [ ] SharePoint 2013

Expected or Desired Behavior

Provision List View with NewDocumentTemplates for Modern Template from Extracted PnP

Observed Behavior

The Url in NewDocumentTemplates inside List View SchemaXml contains token {site} from Extract which is not Parsed on Provisioning and therefore fails.

Steps to Reproduce

Add for example a Word as Template in a Modern List via "+ Add template". Use PnP Powershell to get Template PnP - you can check XML and will see the {site} token in url below NewDocumentTemplates. Now use PnP Powershell to Apply Template to a new Site - if you go to the List -> New and Try to use your Entry - it will Fail.

Further Info:

ObjectListInstance ->createView : Needs special treatment like "CustomFormater" but to replace {site} token.

Sample Attribute:

[{"templateId":"NewFolder","title":"Folder","visible":true},{"contentTypeId":"0x010100567D7D52900A424CB1180EC03B30AADE","isUpload":true,"templateId":"Template_Protokoll","title":"Template_Protokoll","url":"{site}/Shared Documents/Forms/Template_Protokoll.docx","visible":true},{"templateId":"NewDOC","title":"Word document","visible":true},{"templateId":"NewXSL","title":"Excel workbook","visible":true},{"templateId":"NewPPT","title":"PowerPoint presentation","visible":true},{"templateId":"NewONE","title":"OneNote notebook","visible":true},{"templateId":"NewXSLSurvey","title":"Excel survey","visible":true},{"templateId":"NewXSLForm","title":"Forms for Excel","visible":true},{"templateId":"NewVSDX","title":"Visio drawing","visible":true}]
ghost commented 5 years ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

czullu commented 5 years ago

Strange - can not be reproduced again - {site} gets resolved as it should in
var viewElement = XElement.Parse(parser.ParseString(view.SchemaXml)); I see no way how {site} Token could not be added to Parser.