Doc Library webpart "New" button missing

Brass Contributor

Hi guys,

 

I'm experiencing some weird behaviour from the Document Library webpart. When provisioning a new site through code, we add the doc library webpart to the first section programatically. 

But even though the "Everyon" group has contribute rights, the user cannot see the "New" button on the webpart. The "sync" button is also gone as is the "view" selection button. 

 

printscreen.png

but when I view the site as site collection admin i can see all the buttons

 

printscreen2.png

So I'm guessing its a permissions issue, but "Everyone" hase contribute rights. And even if I make "Everyone" Owner of the site, they still cant see the new button.

 

Maybe we made a mistake while adding the webpart through code, but then you would expect that adding a new webpart manually would solve it, but even then, the "new" button is still not visible. 

 

So it must be a permissions issue, but no clue why. 

I do see some change in the permissions side panel. Is MS doing something with it??

Where are the group labels???

printscreen3.png

 

3 Replies

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.

 

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...

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-UR...

 

Can somebody from MS please confirm this is a bug?