mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-08 18:44:22 +00:00
Merge pull request #1277 from tdonohue/DS-3039
DS-3039 : Fix Community item counting logic. Also cleanup item counting elsewhere in code
This commit is contained in:
@@ -576,22 +576,6 @@ public class CommunityServiceImpl extends DSpaceObjectServiceImpl<Community> imp
|
||||
authorizeService.authorizeAction(context, community, Constants.WRITE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int countItems(Context context, Community community) throws SQLException {
|
||||
int total = 0;
|
||||
// add collection counts
|
||||
List<Collection> cols = community.getCollections();
|
||||
for (Collection col : cols) {
|
||||
total += itemService.countItems(context, col);
|
||||
}
|
||||
// add sub-community counts
|
||||
List<Community> comms = community.getSubcommunities();
|
||||
for (int j = 0; j < comms.size(); j++) {
|
||||
total += countItems(context, comms.get(j));
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Community findByAdminGroup(Context context, Group group) throws SQLException {
|
||||
return communityDAO.findByAdminGroup(context, group);
|
||||
|
Reference in New Issue
Block a user