Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-72990

Removing user site removes all user's MB subcsriptions (not only for site being removed)

    Details

      Description

      When removing site from user, all user subscriptions (for all site) are being removed.

      Expected behavior: only subscriptions for deleted site should be removed.

       

      Issue found in:

      com.liferay.portal.subscription.CleanUpSubscriptionMessageListener#processUser:

      protected void processUser(User user, long groupId)
       throws PortalException, SystemException {
      
       // Get the list of groups the current user is still a member of and
       // verify that subscriptions outside those groups are automatically
       // removed as well
      
       List<Group> groups = user.getMySiteGroups(true, QueryUtil.ALL_POS);
      
       long[] groupIds = getGroupIds(groups);
      
       List<Subscription> subscriptions =
       SubscriptionLocalServiceUtil.getUserSubscriptions(
       user.getUserId(), QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
      
       for (Subscription subscription : subscriptions) {
       try {
       processSubscription(subscription, groupId, groupIds);
       }
       catch (Exception e) {
       if (_log.isWarnEnabled()) {
       StringBundler sb = new StringBundler(8);
      
       sb.append("Subscription was not removed for class name ");
       sb.append(subscription.getClassName());
       sb.append(" with class PK ");
       sb.append(subscription.getClassPK());
       sb.append(" in group ");
       sb.append(groupId);
       sb.append(" for user ");
       sb.append(subscription.getUserId());
      
       _log.warn(sb.toString());
       }
       }
       }
      }

      (All subscriptions are processed, not only for site's groupId)

       

      Regards,

      Vitaliy 

        Attachments

          Activity

            People

            Assignee:
            sharry.shi Sharry Shi
            Reporter:
            v.koshelenko Vitaliy Koshelenko
            Participants of an Issue:
            Recent user:
            Sharry Shi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              3 years, 51 weeks, 4 days ago

                Packages

                Version Package
                6.2.X EE
                7.0.X
                Master