pnp / pnp/powershell

[BUG] Add-PnPPageImageWebPart: Server relative urls must start with SPWeb.ServerRelativeUrl

Open
#4,901 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
904
Forks
407
Avg merge
9h 16m
Merged PRs (30d)
10

Description

Reporting an Issue or Missing Feature

Add-PnPPageImageWebPart: Server relative urls must start with SPWeb.ServerRelativeUrl

I get this regardless of the url passed.

Expected behavior

I expect the image webpart to be added to the page with the url specified set to its properties.

Actual behavior

script reports
Add-PnPPageImageWebPart: Server relative urls must start with SPWeb.ServerRelativeUrl

Steps to reproduce behavior

load a page and run
Add-PnPPageImageWebPart -Page $page-ImageUrl "/Sites/SiteWithImage/Library/image.png" -Section 1 -Column 1 -Connection $Global:webconnection

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

2.12.0

Which operating system/environment are you running PnP PowerShell on?
  • [X ] Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Add-PnPPageImageWebPart command entry point and reproduce the reported command against a SharePoint page using the supplied server-relative image URL. Trace where the URL is validated against SPWeb.ServerRelativeUrl; done means valid server-relative URLs add the image web part with the requested URL in its properties, without the reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.