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

Issue with SPO Modern Page URL Report #516

Closed
danelson276 opened this issue May 8, 2023 · 4 comments
Closed

Issue with SPO Modern Page URL Report #516

danelson276 opened this issue May 8, 2023 · 4 comments

Comments

@danelson276
Copy link

I'm attempting to use the https://github.com/pnp/script-samples/tree/main/scripts/spo-modern-page-url-report. I've copied the code and using it without changes. The code works up until listing the links and URLs associated with the Quick Link web parts. The code identifies the pages, identifies the Quick Link web parts, but doesn't return the name of the web part nor does it return the items and links associated with the items. Screen shot below:
image

I've narrowed the issue to this section of code:
$summaryLinks | Foreach-Object{

        $wpTitle = $_.title
        Write-Host "Web Part Title: $($wpTitle)"

        $serverContent = $_.ServerProcessedContent | ConvertFrom-Json
		$itemCount = $serverContent.links.Count
		
        #{htmlStrings, searchablePlainTexts, imageSources, links...}
        Write-Host "Item Count: $($itemCount)"

I believe the ConvertFrom-Json is not returning the expected values - $serverContent has no values after the cmdlet ConvertFrom-Json:
serverContent: @{htmlStrings=; searchablePlainTexts=; imageSources=; links=; componentDependencies=; customMetadata=}

If I comment out the ConvertFrom-Json, the $serverContent returns the following for one Quick Link Web part:
{"htmlStrings":{},"searchablePlainTexts":{"title":"QL Number one","items[0].title":"Another Test Link","items[1].title":"This site's home page"},"i
mageSources":{"items[0].rawPreviewImageUrl":"/sites/3rdTestTeamSiteforTemplateTest/_api/v2.1/sites/[domainremoved].sharepoint.com,e16f023a-947e-4cdd-be6a-6b127
c3ef342,ca72a879-b211-4ae7-989b-b166af612621/items/9c034063-74bd-4f19-a936-8534bff05257/driveItem/thumbnails/0/c400x99999/content?preferNoRedirect=true"},"links":{
"baseUrl":"https://[domainremoved].sharepoint.com/sites/3rdTestTeamSiteforTemplateTest","items[0].sourceItem.url":"/sites/3rdTestTeamSiteforTemplateTest","item
s[1].sourceItem.url":"/sites/3rdTestTeamSiteforTemplateTest/SitePages/Home.aspx"},"componentDependencies":{"layoutComponentId":"706e33c8-af37-4e7b-9d22-6e5694d92a6
f"},"customMetadata":{"items[0].rawPreviewImageUrl":{"fixedWidth":100,"minCanvasWidth":32767}}}

Any help would be greatly appreciated!

@danelson276
Copy link
Author

Paul - thank you so much. I upgraded to PS7.3 and it is working as designed. Brilliant!!!

@danelson276
Copy link
Author

Paul - One minor issue but wanted to make you aware of it. We're not getting the name of the Quick Links web part - all were seeing is a 'default' title of 'Quick Links'. Would you have time to look at this?
image

@pkbullock
Copy link
Collaborator

Thanks @danelson276 I will take a look, hopefully just a small property tweak.

@pkbullock
Copy link
Collaborator

Closing this issue as fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants