1

I have a community site collection which use to have three members, then i remove two members from the community site. but on the home page still the number of members under the "what happening" section is three instead of one as follow:-

enter image description here

and if i click on the members section , it will show one member, so why the members counter is still displaying three members ?

2
  • I'm guessing this is something to do with the user information list - but I don't know what. Looking into that further may help to yield you an answer!
    – Michael A
    Sep 11, 2013 at 0:48
  • I am having similar issue, its slightly more interesting. 'What's happening' web part was working file till member count reached 20, after that it is kind of stuck in "20". I have updated web property using designer hundreds of times, however as soon as any new member joins/leaves the community it is back to 20. Other 2 parameters are showing correct count for discussion and replies. I am assuming it is doing that with member count since default view in members list is configured to show 20 records at a time (I may be wrong). Any help on how to fix it permanently. Jul 18, 2016 at 16:19

2 Answers 2

1

This is the default behaviour of the product. I don't know why Microsoft decided this because is odd. If you Leave the communnity still presents the same number.

I have already written to Microsoft so that they check it but it seems to be the desired behaviour because the community stores your historical data (badges, discussions, etc) and never will be removed

UPDATE

I want to show you a code to get the members of a community that are already joined.

SPWeb web = SPContext.Current.Web;

SPList Members = web.Lists.TryGetList("Community Members"));
try
{
    SPQuery query = new SPQuery();
    query.Query = "<Where><Eq><FieldRef Name="MemberStatusInt"/><Value Type="Integer">1</Value></Eq></Where>";
    SPListItemCollection colection = Members.GetItems(query);
    int membersJoined = colection.Count
}
catch (Exception)
{
}

The field MemberStatusId indicates if the member "belongs" or not to the community. If the value is 2 the member ever left the community. Actually, when you leave the community the field MemberStatusId is set to 2 and ReputationScore is set to -1

Create a WebPart with a label indicating the "real" members of the community using the code provided. Good Luck

1
  • so if you click on the members section you will find different number of members comparing to the counter !!. the problem in my case is that i have backup the community site from my staging to my production, and i have removed the test members from my community, but seems that the counter will keep considering them .any advice?
    – John John
    Sep 11, 2013 at 9:28
0

The reason you get wrong number is the webpart is reading from the web property bag. So the option would create a new web part that is suggested by Alvmad above or updating the web property bag. The last option is maybe not be way. Since i'm not sure if this is even supported by Microsoft.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.