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

SSOM - WebPartPageDefinition.CustomPageLayout seems to put only the last web part on the page #869

Closed
SubPointSupport opened this issue Aug 9, 2016 · 1 comment

Comments

@SubPointSupport
Copy link
Contributor

Community feedback:

I have a trouble with web parts deployment to custom web part page. Only last webpart is in place after deployment.

Here sample project https://1drv.ms/f/s!Auj50aSh0LAUmr92mZh1Nnnvgry5IQ

https://www.yammer.com/spmeta2feedback/#/Threads/show?threadId=746247724

@SubPointSupport
Copy link
Contributor Author

Problem

If WebPartPageDefinition uses CustomPageLayout and NeedOverride = true, then M2/SSOM provisions web parts on the web part page incorrect. Only the last one web part is present on the page out of many which were to be provisioned.

Why we miss that

CanDeploy_WebpartToWebpartPage() simulates the giving case with OOTB page and several web part. M2 did not have a test with custom web part page layout + several web part on which the issue occurs.

Technical details

M2/SSOM WebPartPageModelHandler resolved the web part page to continue provision of every single web part. WithResolvingModelHost() method is used to lookup the web part page. Further, GetOrCreateNewWebPartFile() is called to get the page.

Unfortunately, GetOrCreateNewWebPartFile() method would override the web part page if WebPartPageDefinitoin.NeedOverride is true. This is incorrect behaviour as the web part page has to be only found by provision to continue the chain.

Resolution 1

  • Upgrade to SPMeta2 1.2.8 (August, 2016)

Resolution 2

  • Use SPMeta2 <1.2.8
  • Set 'NeedOverride = false in your web part page definitions

Resolution 3

  • Use SPMeta2 <1.2.8
  • Use OOTB web part pages avoiding custom web part page layout

A new test CanDeploy_WebpartToWebpartPage_WithCustomPageLayout is to handle that case.

@SubPointSupport SubPointSupport changed the title Web part provision seems to put only the last web part on the page SSOM - WebPartPageDefinition.CustomPageLayout seems to put only the last web part on the page Aug 12, 2016
SubPointSupport added a commit that referenced this issue Aug 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant