You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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
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
Community feedback:
https://www.yammer.com/spmeta2feedback/#/Threads/show?threadId=746247724
The text was updated successfully, but these errors were encountered: