Retrieving modern page from the root site fails with an error
o365 spo page get -u https://contoso.sharepoint.com -n page1Information about the page
Error: serverRelativeUrl
Parameter name: Specified value is not supported for the serverRelativeUrl parameter.
macOS
zsh
CLI v2.6.0
Issue occurs on other environments as well. The problem is on line 42 where the code states:
args.options.webUrl.indexOf('/', 8). Doing that on the root URL returns a -1.
I suggest to create a reusable method to check return the relative URL and implement that in other methods as the getfilebyserverrelativeurl is used throughout the files actions (move, remove, checkout etc) and I assume that the same issue occurs there.
Feel free to assign to me :)
Thanks for the investigation @appieschot, issue assigned 馃憤馃徎
We (myself, @waldekmastykarz & @VelinGeorgiev) recently discussed that it would be a good idea to start adding tests that reproduce the bug as well as the code fixes. This way we can make sure that the bug is covered and it was also help increase the quality of our testing. Are you ok to look into providing that as well?
Yes that does make sense. I will start with adding the test to the page methods to see if they all fail and implement a fix on the correct places.
Great stuff @appieschot !
Most helpful comment
Yes that does make sense. I will start with adding the test to the page methods to see if they all fail and implement a fix on the correct places.