sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

HelloWorld list view command set extension fails to load when switching between lists in left-hand nav in team site

Open erwinkehrt opened this issue 6 years ago • 11 comments

Category

  • [x] Bug

Describe the bug

A generic hello world list view command set extension that is targeted towards generic lists (RegistrationId=100) will not load when switching between lists if they are in the site navigation. Neither the onInit nor onListViewUpdated functions fire off when you click on the second list. Please see GIF below. The extension should show up on both lists. If you do a hard refresh on the second list, then the extension shows up correctly. Please note that this only breaks on a team site and NOT on a communication site.

Untitled

Steps to reproduce

  1. Create hello world list view command set extension with yeoman (see image below)
  2. Deploy to app catalog
  3. Install application on a team site
  4. Create 2 generic lists on your team site and add them to the site navigation
  5. Go to home page
  6. Go to first list (extension shows up)
  7. Go to second list (extension does NOT show up but it should)

Screen Shot 2020-05-20 at 5 55 58 PM

Expected behavior

The extension should show up on both lists when navigated to from the site navigation.

Environment details (development & target environment)

  • OS: Mac 10.15.3
  • Framework: Node 8.17.0
  • Browser(s): Chrome Version 80.0.3987.149
  • Tooling: VS Code 1.45.1, SPFx v1.10.0
  • SharePoint Online
  • Out of the box team site

Additional context

I uploaded my sample project here in case it helps. Thanks.

Thanks for your contribution! Sharing is caring.

erwinkehrt avatar May 20 '20 23:05 erwinkehrt

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

msft-github-bot avatar May 20 '20 23:05 msft-github-bot

We have the bug in our tenant as well.

nmnikolov avatar May 28 '20 12:05 nmnikolov

I think this issue could be a duplicate of #5704 - we experience the same.

chr-sad avatar May 28 '20 13:05 chr-sad

We have a SPFX listview command set extension, web part which stopped working/displaying suddenly. There is no error. Another test extension works fine

preetippatki avatar Jun 02 '20 05:06 preetippatki

@nmnikolov @chr-sad an update on this for you guys, we have fixed this issue temporarily so I am closing this bug. Also, we spoke with a Microsoft guy and they are supposedly releasing a fix for this in the coming weeks so keep an eye out for that.

Our temporary fix was to delete the links from the quick launch nav menu. Then you will have to add new ones, but when you are adding them, add them to follow this format: https://tenantName.sharepoint.com/sites/siteName/libraryName

The main point is to delete the default nav link to the doclib or list and create your own in this way. At least for us, that fixed the issue. By the way, this was only happening for us on team sites, although the same fix should work on communication sites but we were not seeing the issue there.

@preetippatki this issue might help you, #5509. If you have one solution with a web part and extension inside of it, depending on how you deploy it the first time it will make your web part disappear. You can add the web part to your package-solution.json file as mentioned in 5509 or you can uninstall the app from your site, delete it from the first and second level recycle bins, and reinstall it.

erwinkehrt avatar Jun 08 '20 15:06 erwinkehrt

@erwinkehrt thanks for the response. I have only one extension and I tried to uninstall and install it again. It does not work.

preetippatki avatar Jun 08 '20 23:06 preetippatki

Hmm, then I would start by placing some break points using Chrome dev tools in the onInit and onListViewUpdated functions and making sure that it is at least hitting those. That would tell me where to look next. Good luck!

erwinkehrt avatar Jun 09 '20 02:06 erwinkehrt

@erwinkehrt thanks for the information. I just tried out the temporary fix in our team site, but it did not work. If i use https://tenantName.sharepoint.com/sites/siteName/libraryName i get a 404 response, if I use the full qualified URL of the list including https://tenantName.sharepoint.com/sites/siteName/Lists/libraryName/AllItems.aspx the URL is trimmed and it does not change the behaviour in our tenant. But I am glad to hear, Microsoft will provide a fix.

chr-sad avatar Jun 09 '20 06:06 chr-sad

@chr-sad I think that happens if you do not delete the nav link first. You have to edit your nav links, delete the nav link that goes to the library, save the changes, refresh the page, edit nav links again, add a new nav link, and then that is where you put the new URL without "/AllItems.aspx"

Also, I noticed something I missed in my original comment. The format for the URL should be https://tenantName.sharepoint.com/sites/siteName/Lists/listName if your link is to a list. If your link is to a document library, then the format is https://tenantName.sharepoint.com/sites/siteName/libraryName.

Once you add the new nav link, the URL ends up looking like this for a list once Sharepoint trims the first part off:

Screen Shot 2020-06-10 at 12 06 25 AM

or like this for a document library:

Screen Shot 2020-06-10 at 12 13 31 AM

I just tried it on my dev site and can confirm it works in at least 2 different tenants for us. I'm attaching a picture just for clarity. I'm also attaching a GIF to show you the results.

Hopefully this can help you get it to work, please let me know!

Screen Shot 2020-06-09 at 11 51 48 PM

Untitled

erwinkehrt avatar Jun 10 '20 05:06 erwinkehrt

@erwinkehrt you are right - thank you! The key is to remove the entry in the left nav first. Otherwise if it's only an additional Link like I did there is no change. I just did not delete the link before because I wanted to test, if Microsoft fixes the issue in the next few weeks like you mentioned - it was my fault. Thanks again for your help! :)

chr-sad avatar Jun 10 '20 08:06 chr-sad

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

msft-github-bot avatar Jun 17 '20 12:06 msft-github-bot