Pnpframework: [BUG] ConvertTo-PnPPage fails with 'Property BannerImageUrl does not exist on this entity'

Created on 17 Feb 2021  路  9Comments  路  Source: pnp/pnpframework

Reporting an Issue or Missing Feature

Issue

Expected behavior

Using ConvertTo-PnPPage should successfully create a modern version of a classic wiki page.

Using the ConvertTo-PnPClientSidePage cmdlet from SharePointPnPPowerShellOnline (version 3.29.2101.0) against the same wiki page with the same parameters successfully converts the page.

Actual behavior

Using ConvertTo-PnPPage to convert a classic wiki page to a modern PnP Page fails with 'ConvertTo-PnPPage : Property BannerImageUrl does not exist on this entity':

PS C:> ConvertTo-PnPPage -Identity "Domains.aspx" -KeepPageCreationModificationInformation -DisablePageComments -Library "Wiki" -Overwrite -TakeSourcePageName
ConvertTo-PnPPage : Property BannerImageUrl does not exist in this entity
At line:1 char:1
+ ConvertTo-PnPPage -Identity "Domains.aspx" -KeepPageCreationModificat ...
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (:) [ConvertTo-PnPPage], ClientException
+ FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.Pages.ConvertToClientSidePage

Steps to reproduce behavior

  1. Connect-PnPOnline -PnPManagementShell -Url https://domain.sharepoint.com/sites/sitecollection -LaunchBrowser
  2. ConvertTo-PnPPage -Identity "Domains.aspx" -KeepPageCreationModificationInformation -DisablePageComments -Library "Wiki" -Overwrite -TakeSourcePageName

In addition, creating a classic wiki page containing the same contents in the SitePages library fails in the same way. E.g. minimal command:
PS C:> ConvertTo-PnPPage -Identity "Domains2.aspx"
ConvertTo-PnPPage : Property BannerImageUrl does not exist in this entity
At line:1 char:1
+ ConvertTo-PnPPage -Identity "Domains2.aspx"
+ ~~~~~~~~~~~
+ CategoryInfo : WriteError: (:) [ConvertTo-PnPPage], ClientException
+ FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.Pages.ConvertToClientSidePage

What is the version of the Cmdlet module you are running?

Tried with 1.3.0 and 1.3.6-nightly and get the same result on two separate Windows 10 computers.

Which operating system/environment are you running PnP PowerShell on?

  • [X ] Windows
  • [ ] Linux
  • [ ] MacOS
  • [ ] Azure Cloud Shell
  • [ ] Azure Functions
  • [ ] Other : please specify
page transformation 馃 question

All 9 comments

Hi @Andy-Dawson ,

From my side this seems to work...can you provide some more details on the source site? Does it have a SitePages library available? Can you manually create modern pages in that SitePages library? Also please run the page transformation with logging and share the resulting log + run Get-PnPException immediately after the error happens and provide that output as well.

image

Hi @jansenbe ,

The source site is an old Classic Team Site. It's had the feature enabled on it to allow the creation of Site Pages in the SitePages library (and as originally mentioned, using the deprecated ConvertTo-PnPClientSidePage cmdlet from SharePointPnPPowerShellOnline works without issue, creating a modern copy of the 'Domains.aspx' page in /SitePages/Wiki, in the same site collection) and I have created a modern page manually in the SitePages library. The site does have both the site collection and site publishing features enabled on it, but the page I'm trying this on is a wiki page (tried adding the appropriate parameters to convert a publishing page just in case, but the cmdlet told me it wasn't a publishing page, as expected).

'Get-PnPException' gave me:
Message : Property BannerImageUrl does not exist in this entity
Stacktrace : at PnP.Core.Model.ExpandoBaseDataModel`1.get_Item(String key)
at PnP.Core.Model.SharePoint.Page.d__128.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at PnP.Core.Model.SharePoint.Page.Save(String pageName)
at
PnP.Framework.Modernization.Transform.PageTransformator.Transform(PageTransformationInformation
pageTransformationInformation)
at PnP.PowerShell.Commands.Pages.ConvertToClientSidePage.ExecuteCmdlet()
at PnP.PowerShell.Commands.PnPSharePointCmdlet.ProcessRecord()
ScriptLineNumber : 1

I've attached the verbose log from the conversion process.

Page-Transformation-Report-17-02-2021-17-27-23.zip

Hi @jansenbe ,

I have just created a new Classic Team Site, added a wiki page library, created a couple of pages, then run the same conversion and it worked just fine. Looks like it's this source site after all :-(

Opened again as I want to do some checking

Hi @jansenbe ,

Please let me know if there's any further information I can provide!

@Andy-Dawson : on the site showing the issue can you run this script and let me know the result:

$list = Get-PnPList -Identity sitepages -Includes "Fields"
$list.Fields | Where-Object { $_.InternalName -eq "BannerImageUrl"}

Hi @jansenbe ,

Here's the output:

Title InternalName Id
----- ------------ --
Banner Image URL BannerImageUrl 5baf6db5-9d25-4738-b15e-db5789298e82

ok, so the BannerImageUrl field is present in the library

@Andy-Dawson : we had an issue that could result in a wiki page library mistakenly being detected as the site's site pages library. This has been fixed and most likely also fix this one. Closing the issue, please create a new issue if you still see problems

Was this page helpful?
0 / 5 - 0 ratings