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

SharePoint Graph Pages API: Internal Server error on PATCH canvaslayout #8793

Closed
1 of 9 tasks
redlab-chris opened this issue Feb 25, 2023 · 4 comments
Closed
1 of 9 tasks
Labels
area:pages Category: SharePoint Pages API relate type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

Comments

@redlab-chris
Copy link

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

SharePoint REST API

Developer environment

Windows

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

  • browser version
  • SPFx version
  • Node.js version
  • etc

Describe the bug / error

Graph API responds with "Internal server error 500" on

https://graph.microsoft.com/beta/sites/365redlab.sharepoint.com,c006d14d-1e79-4dc1-9048-9ec48991f220,46067dc3-f26c-414e-a048-994708d6bfd1/pages/31d76036-bc22-41c5-afe3-e62ea9ecd479

with payload:

{
"canvasLayout": {
"horizontalSections": [
{
"id": "1",
"layout": "oneColumn",
"columns": [
{
"id": "1",
"webparts": [
{
"@odata.type": "#microsoft.graph.textWebPart",
"id": "de53338c-f4a3-4a5a-8314-111ac94717e3",
"innerHtml": "

some text

"
}
]
}
]
}
]
}
}

Steps to reproduce

  1. open graph explorer
  2. run the query
  3. with the payload

This does reproduce on this exact page

sites/365redlab.sharepoint.com,c006d14d-1e79-4dc1-9048-9ec48991f220,46067dc3-f26c-414e-a048-994708d6bfd1/pages/31d76036-bc22-41c5-afe3-e62ea9ecd479

and not for other pages in our tenant

image

Expected behavior

The canvas layout of the page is updated

@redlab-chris redlab-chris added the type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs. label Feb 25, 2023
@ghost
Copy link

ghost commented Feb 25, 2023

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

@ghost ghost added the Needs: Triage 🔍 Awaiting categorization and initial review. label Feb 25, 2023
@VesaJuvonen VesaJuvonen added area:pages Category: SharePoint Pages API relate and removed Needs: Triage 🔍 Awaiting categorization and initial review. labels Feb 26, 2023
@kkgthb
Copy link

kkgthb commented Mar 23, 2023

I, too, get 500 errors every time I try to submit a PATCH request whose only job is to update canvasLayout.

Here's the request body from an example of me trying to blow the content out of the water on a page that currently has 3 full-width horizontal sections (#1, #2, & #3) and replace it with a page that just has 1 vertical section in it, as a sort of Hello World operation (I am using the Graph Explorer to push through the request):

{
  "@odata.type": "#microsoft.graph.sitePage",
  "canvasLayout": {
    "@odata.type": "#microsoft.graph.canvasLayout",
    "verticalSection": {
      "@odata.type": "#microsoft.graph.verticalSection",
      "emphasis": "none"
    }
  }
}

I've also tried it with a horizontalSections property instead of a verticalSection property whose value was a 1-object-long list, with the object properties still having an @odata.type and emphasis but this time also having a layout of fullWidth.

Same 500 error.

PATCH isn't completely broken, though, as this JSON body works just fine:

{
  "@odata.type": "#microsoft.graph.sitePage",
  "title": "another title change",
  "showComments": false,
  "showRecommendedPages": false
}

PATCH simply seems to be broken for the way canvasLayout allegedly works according to Update sitePage.

This is extremely show-stopping as there are no API endpoints, PNP CLI commands, etc. to delete text webparts, edit text webpart contents, delete columns, edit column contents, delete sections, edit section contents, etc. The only way to edit the contents of an existing page seems to be PATCH with a canvasLayout request body and it seems to be broken.

Deleting and recreating the page isn't a valid workaround option because that would blow carefully-curated page-read permissions out of the water.

Thanks for your attention!

@divyachapan
Copy link
Collaborator

Issue resolved.

@ghost
Copy link

ghost commented Apr 26, 2023

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

@ghost ghost locked as resolved and limited conversation to collaborators Apr 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:pages Category: SharePoint Pages API relate type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.
Projects
None yet
Development

No branches or pull requests

4 participants