Modernization: Problem with the webpartmapping.xml for documents relative path

Created on 11 Dec 2019  路  8Comments  路  Source: pnp/modernization

Thank you for reporting an issue or suggesting an enhancement. We appreciate your feedback - to help the team to understand your needs, please complete the below template to ensure we have the necessary details to assist you. Thanks!

Category

[ x] Bug
[ ] Enhancement

Problem Area

I try to convert classic pages to modern. Url is mytenant.com/classicsite
to mytenant.com/sites/modernsite

All files that do not have documents work, however the problems I have documents gets an error:

"Parameter ServerRelativeFileName was used but is not listed as a web part property that c
an be used."

and:
"ConvertTo-PnPClientSidePage : Parameter ImageUrl was used but is not listed as a web part property that can be used."

I have identified three lines in the mapping XML that causes this problem:

" "

""

""

Expected or Desired Behavior

I want to transform classical pages to modern, with documents and with right URLs pointing at them.

Observed Behavior

Error message and the sites does not get converted.

Steps to Reproduce

Use the default webpartmapping
convert classic site with documents with relative url and convert them to modern.

I guess its the matter of the attributes in the XML but I dont know what to write there. Im also wondering if its possible to convert classical sites with documents, and use these documents in the document viewer web part in modern pages where the user can read the document onsite?

bug PageTransformationEngine

All 8 comments

Hey @Alper2 , can you run the page transformation with logging enabled (add -LogType File -LogVerbose -LogFolder c:\temp) and provide the created log file. Based on your above feedback I guess the issue is with images inside wiki content?

Hi, I'm having an issue that seems to be very close to this. I'm trying to convert a publishing page that contains a link to the Word document icon from _layouts.

Edit for clarificaiton:
The publishing page I'm trying to convert contains a link and an <img> reference to an image located in /_layouts/images/icdocx.png. Having this link in the page seems to cause the convertion to break due to it not being able to "transfer the asset".

From the console debug log:

Asset was not transferred as it was not found in the source web. Asset: /sites/[siteurl]/_layouts/images/icdocx.png

The complete error logged is:

Error: [Web Part Mapping] An error occurred processing functions - Parameter ServerRelativeFileName was used but is not listed as a web part property that can be used. Error: Parameter ServerRelativeFileName was used but is not listed as a web part property that can be used. StackTrace:    at SharePointPnP.Modernization.Framework.Functions.FunctionProcessor.ParseFunctionDefinition(String function, Property property, WebPart webPartData, WebPartEntity webPart)
   at SharePointPnP.Modernization.Framework.Functions.FunctionProcessor.ExecutePropertyFunctions(String[] functionsToProcess, WebPart webPartData, WebPartEntity webPart, Property property)
   at SharePointPnP.Modernization.Framework.Functions.FunctionProcessor.Process(WebPart& webPartData, WebPartEntity webPart)
   at SharePointPnP.Modernization.Framework.Transform.ContentTransformator.Transform(List`1 webParts)
Error: [Summary] A critical error occurred - transformation did not complete Error: Parameter ServerRelativeFileName was used but is not listed as a web part property that can be used. StackTrace:    at SharePointPnP.Modernization.Framework.Functions.FunctionProcessor.ParseFunctionDefinition(String function, Property property, WebPart webPartData, WebPartEntity webPart)
   at SharePointPnP.Modernization.Framework.Functions.FunctionProcessor.ExecutePropertyFunctions(String[] functionsToProcess, WebPart webPartData, WebPartEntity webPart, Property property)
   at SharePointPnP.Modernization.Framework.Functions.FunctionProcessor.Process(WebPart& webPartData, WebPartEntity webPart)
   at SharePointPnP.Modernization.Framework.Transform.ContentTransformator.Transform(List`1 webParts)
   at SharePointPnP.Modernization.Framework.Publishing.PublishingPageTransformator.Transform(PublishingPageTransformationInformation publishingPageTransformationInformation)

I suspect this is due to the transformation engine not being able to transfer a file from the _layouts path as it does not exist in a regular library. Is there a way to simply ignore this error?

I just confirmed that removing the offending icon caused the page to migrate properly.

I could always write a script that strips out such images, but is there a way to address this through the ConvertTo-PnPClientSidePage cmdlet or mappings?

The icon is still available in SPO so maybe such images could simply be ignored?

That's good feedback @rudfoss . I'll mark this as bug to investigate and possibly fix as using these _layouts images should indeed work, we simply need to skip them at copy

Thanks for looking into this @jansenbe

Been able to repro the issue, handling _layouts images works fine, but not when they're used as a link. Starting to work on a fix right now

Fixed. Will be part of the January release, which will be released during the first week of January.

@rudfoss , @Alper2 : I'll be closing this issue now. Feel free to open a new issue when you still see issues after testing with the January release.

Was this page helpful?
0 / 5 - 0 ratings