Forum Discussion
Doc Library webpart "New" button missing
So, we isolated the code where this goes wrong.
"updatedList" here is our document library where we add custom content types through code
var updatedListCTs = updatedList.ContentTypes;
Context.Load(updatedListCTs);
Context.ExecuteQueryRetry();
//loading the CTs from the web where we have our Doc Lib
ContentTypeCollection siteCTs = Context.Web.ContentTypes;
Context.Load(siteCTs);
Context.ExecuteQueryRetry();
//here we add one of the web CT to the Doc Lib
updatedList.ContentTypes.AddExistingContentType(siteCT);
updatedList.Update();
Context.ExecuteQueryRetry();
At this point, the New button is gone for all users except the SP Admin user.
- Stefaan De VreeseAug 09, 2018Brass Contributor
Maybe its not even the code, because several users in the company are able to see the "new" button while others can't...
But these users have the same permissions...
We also thought it had something to do with languages, but even if we tweak site/browser/computer language, the results are the same. Some users can see the button, others can't
So we could use some help to figure this out...
- Stefaan De VreeseAug 09, 2018Brass Contributor
We have found the cause of the issue:
When the site collection feature "Open documents in client applications by default" is active, the "New" button on the Modern Doc Lib Webpart disappears.
This also happens when the feature is deactivated, but the Doc Lib setting is put on "Open in client application"
this is also related to my other post: https://techcommunity.microsoft.com/t5/SharePoint/New-Document-List-0-does-not-exist-at-site-with-URL-1/m-p/226069#M20410
Can somebody from MS please confirm this is a bug?