uPortal-Project / uPortal

Enterprise open source portal built by and for the higher education community.
https://www.apereo.org/projects/uportal
Apache License 2.0
270 stars 273 forks source link

Some user favorites disappear after a favorited portlet gets deleted and the user updates their favorites #2800

Closed groybal closed 2 months ago

groybal commented 3 months ago

Describe the bug

A problem has been identified with user favorites being removed after portlet definitions are deleted.

After a portlet is deleted, if a user had that portlet favorited, the section for that portlet in the favorites section of the user's layout is not deleted, but instead appears similar to: { "_objectType": "portlet", "url": "/uPortal/api/v4-3/portlet/DLMStaticMissingChannel.html", "iconUrl": "/uPortal/media/skins/icons/mobile/default.png", "ID": "n241", "chanID": "-1", "description": "", "fname": "DLMStaticMissingChannel", "locale": "en_US", "name": "Missing channel", "timeout": "20000", "title": "Missing channel", "typeID": "-1", ... }

This doesn't initially affect users, as their favorites continue to display. But if they favorite another portlet, then when they log out and back in, the new favorite doesn't appear, and sometimes other portlets have also disappeared. Likewise, if the user removes a favorite, sometimes other portlets have also disappeared. Specifically, in both cases, the portlets that appeared after the deleted portlet ("Missing Channel") no longer appear (they have been removed).

Steps to reproduce

  1. login as any user
  2. favorite four portlets (note the name of the second portlet favorited)
  3. logout
  4. login as an admin user
  5. go to Portlet Admin portlet
  6. delete the portlet that was the second favorited previously
  7. logout
  8. login as same user from step 1
  9. view the Favorites portlet (you'll see that the second portlet favorited is no longer listed but other three remain)
  10. favorite another portlet
  11. view the Favorites portlet (you'll see the four portlets listed)
  12. logout and then log back in
  13. view the Favorites portlet (you'll see that the last three portlets previously seen are no longer listed)

Repeat steps 1-9 with a different user, then follow these steps:

  1. unfavorite the first portlet listed in Favorites portlet
  2. view the Favorites portlet (you'll see the two remaining portlets listed)
  3. logout and then back in
  4. view the Favorites portlet (you'll see that the two portlets are no longer listed)

Expected behavior

After a portlet has been deleted, it should no longer appear as a favorite in the Favorites portlet for users that had favorited the portlet. This works fine. When those users subsequently modify their favorites (either by adding new ones or removing existing), no additional portlets should disappear automatically.

Stacktrace

No response

uPortal version

uPortal 5.16.1

OS

No response

Browser

No response