Problem with Quick Links webpart creation via C# code, doesn't show in UI ?

Copper Contributor

Hi,

Since yesterday we noticed that adding & updating Quicklinks webpart using C# Code doesn't work right anymore. It could be an issue from before but we noticed this only yesterday.  

 

I will be providing some screenshots too as per the state of our team site, code/results, etc... so you can see what's going.  

 

So here's the initial screen before adding anything: {quicklinks1.png} . As you can see we have 2 other webparts on the home page, one for document list, one for people/colleagues.  

 

Now for some code, here's what my BO looks like that I'm using to create the quicklinks webpart: {quicklinks2.png} . As you can see I am giving with the site url & title of where the link (in the quicklinks webpart) should point to.  

 

I'm creating the quicklinks webpart according to this tutorial : https://gist.github.com/zplume/ca292d0f03451b285753e681514d182c , using SharePoint PnP .   

 

This used to work, but now it doesn't anymore. This used to create a quicklinks webpart on my homepage of my modern team site, filled with 1 quick link to the desired site. This is what it looks now after creation with code: {quicklinks3.png} , but here's how it should look (this is a previously created site with EXACTLY the same code) : {quicklinks4.png} .  

 

When looping through my code and checking for existing links, it DOES recognise my quicklinks webpart on the page and knows there's a link in it as my code created it, but doesn't show in the UI...  

 

Why doesn't it show in the UI? Also when I want to edit the webpart itself (in the edit page of my modern team site), the button does nothing and has no responding action behind it : {quicklinks5.png} . After about 15-20 seconds, suddenly the edit button (on the webpart) does what it should and the click eventlistener seems to work (and I can edit the webpart).  

 

If I click on the "+ Add" button in the webpart, I'm taken to this page: {quicklinks6.png} , where I've added Google as a link. Then this happens: {quicklinks7.png} . Thinking it failed, I try again: {quicklinks8.png} . Now he suddenly knows there's 2? When publishing my edits on the page, now it shows 2 links to Google. But where's my link that I created via code? 

 

Could it be possible some update broke the Quicklinks webpart?

0 Replies