[BUG] Add-PnPPageWebPart Cannot Set Images for ImageGallery
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 904
- Forks
- 407
- Avg merge
- 9h 16m
- Merged PRs (30d)
- 10
Description
Reporting an Issue or Missing Feature
Very similar to some earlier bugs related to the Image web part, I'm unable to add images to the Image Gallery web part. I can add an Image Gallery web part that pulls dynamically from a library, but our use case requires select images in a carousel.
Expected behavior
Images appear in the web part
Actual behavior
Spots for the images appear in the web part, but the images aren't visible.
Steps to reproduce behavior
I've tried both Add-PnPPageWebPart and Set-PnPPageWebPart, with the same results.
Add-PnPPageWebPart -Page $pageTitle -DefaultWebPartType ImageGallery -Section 1 -Column 1 -WebPartProperties $wpPropJson
Where images json in the $wpPropJson variable is like below. The galleryImgId looks like it might be generated when the images are added manually from the front end. I've tried a few different variations on this.
"images": [
{
"siteId": "18e1477c-5056-4853-8951-15268c006a7f",
"webId": "d1628f6a-d25e-4641-94cd-2de258f3b1dc",
"listId": "{C2DF79CF-273B-4225-9DC4-86A907D46E2F}",
"id": "35707cf1-ef0d-49ae-abdd-72f2567a9051",
"title": "",
"isInList": true,
"description": "",
"altText": "",
"galleryImgId": "cccf24be-a78e-486b-ae1c-84c2296be446"
},
{
"siteId": "18e1477c-5056-4853-8951-15268c006a7f",
"webId": "d1628f6a-d25e-4641-94cd-2de258f3b1dc",
"listId": "{C2DF79CF-273B-4225-9DC4-86A907D46E2F}",
"id": "59d95cd0-47fe-42b7-803b-38cfbea2ffd2",
"title": "",
"isInList": true,
"description": "",
"altText": "",
"galleryImgId": "8af97428-7f0f-42b7-a1db-0f934623e52c"
}
]
What is the version of the Cmdlet module you are running?
2.2.0
Which operating system/environment are you running PnP PowerShell on?
- Windows
- Linux
- MacOS
- Azure Cloud Shell
- Azure Functions
- Other : please specify
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Add-PnPPageWebPart and Set-PnPPageWebPart entry points and reproduce the ImageGallery case using the supplied $wpPropJson images structure. Compare the behavior with images added through the SharePoint front end, including the galleryImgId values. Done means selected images are visible in the Image Gallery web part rather than only showing image placeholders.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100