Skip to:
Content

BuddyPress.org

Opened 7 years ago

Closed 5 years ago

#7526 closed enhancement (fixed)

Counter for "All" tab for activity and groups table

Reported by: bhargavbhandari90's profile bhargavbhandari90 Owned by: slaffik's profile slaFFik
Milestone: 6.0.0 Priority: normal
Severity: normal Version: 2.8.2
Component: Administration Keywords: has-screenshots has-patch reporter-feedback
Cc: Groups, bn.bhandari90@…

Description

Currently there is no counter for "All" tab into activity and groups tables.
Is there any specific reason for that?

Because posts, pages, comments and users tables are showing counter for "All" tab.

Attachments (7)

alltabwithoutcounter.png (9.3 KB) - added by bhargavbhandari90 7 years ago.
activity-counter.png (9.4 KB) - added by bhargavbhandari90 7 years ago.
It should be like this.
7526.patch (3.8 KB) - added by bhargavbhandari90 7 years ago.
We should add the counter for consistency
7526-2.patch (3.8 KB) - added by bhargavbhandari90 7 years ago.
Used existing string. So it will not effect on existing translation.
7526-3.diff (1.4 KB) - added by bhargavbhandari90 5 years ago.
Used total_activity_count
7526-3-group.diff (2.1 KB) - added by bhargavbhandari90 5 years ago.
For group counter
7526.2.patch (10.8 KB) - added by imath 5 years ago.

Download all attachments as: .zip

Change History (27)

@bhargavbhandari90
7 years ago

It should be like this.

@bhargavbhandari90
7 years ago

We should add the counter for consistency

@bhargavbhandari90
7 years ago

Used existing string. So it will not effect on existing translation.

#1 @bhargavbhandari90
7 years ago

  • Keywords has-patch has-screenshots added

#2 @bhargavbhandari90
7 years ago

  • Cc bn.bhandari90@… added

#3 @bhargavbhandari90
7 years ago

  • Milestone changed from Awaiting Review to 2.9

#4 @hnla
7 years ago

  • Milestone changed from 2.9 to Awaiting Review

@bhargavbhandari90 I'm changing this back to _Awaiting Review_ , we'll try & review, hopefully today in the dev chat, and add it to the milestone.

#5 @bhargavbhandari90
7 years ago

@hnla Thank you. Let me know when you do dev chat. I would like to take part into this.

#6 @hnla
7 years ago

BuddyPress slack channel @ 19:00hrs UTC

Last edited 7 years ago by hnla (previous) (diff)

This ticket was mentioned in Slack in #buddypress by hnla. View the logs.


7 years ago

#8 @DJPaul
7 years ago

  • Keywords needs-patch added; dev-feedback has-patch removed
  • Milestone changed from Awaiting Review to Future Release

I suspect it was because the number wasn't convenient in the database queries we are making to build that page.

Your patch has the problem of the query not being cached, of hardcoding the table name (I think we have this as a property on the main class for each Component, e.g. bp()->activity), and because this is not using the existing Activity API.

The last point is not a strict rule, but it's something we like. So, if you can't find the same total number in the activities global object somewhere, then you'd need to add caching around the query, and double-check that we don't hard-code the query name elsewhere (I might be remembering wrong).

#9 @bhargavbhandari90
7 years ago

  • Keywords dev-feedback added

@DJPaul

I got your point for the table name. And also my previous query may effect on DB performance for big database.

Now I am thinking like WP's count method of all post. We can do something like this : https://github.com/WordPress/WordPress/blob/master/wp-includes/post.php?utf8=%E2%9C%93#L2202

This ticket was mentioned in Slack in #buddypress by bhargavbhandari90. View the logs.


7 years ago

#11 follow-up: @DJPaul
7 years ago

Hi!

if you can't find the same total number in the activities global object somewhere,

Did you look at these? BP_Activity_Template has a total_activity_count property which sounds helpful. Are we using the activities template loop for the activities wp-admin screen?

#12 in reply to: ↑ 11 @bhargavbhandari90
7 years ago

Replying to DJPaul:

Hi!

if you can't find the same total number in the activities global object somewhere,

Did you look at these? BP_Activity_Template has a total_activity_count property which sounds helpful. Are we using the activities template loop for the activities wp-admin screen?

I have to check this. Thanks for the info. @DJPaul

Last edited 7 years ago by bhargavbhandari90 (previous) (diff)

#13 follow-up: @DJPaul
7 years ago

Did you get anywhere with this @bhargavbhandari90 ?

@bhargavbhandari90
5 years ago

Used total_activity_count

#14 in reply to: ↑ 13 @bhargavbhandari90
5 years ago

Replying to DJPaul:

Did you get anywhere with this @bhargavbhandari90 ?

Hi @DJPaul

After almost 2 years, I saw this :). Yes you were right. We can use total_activity_count property. Thanks.

@bhargavbhandari90
5 years ago

For group counter

#15 follow-up: @imath
5 years ago

  • Milestone changed from Awaiting Contributions to Up Next

Thanks a lot for your patches @bhargavbhandari90 we're too close to 5.0.0 release, but let's try to include your improvements during the next development cycle.

#16 in reply to: ↑ 15 @bhargavbhandari90
5 years ago

Replying to imath:

Thanks a lot for your patches @bhargavbhandari90 we're too close to 5.0.0 release, but let's try to include your improvements during the next development cycle.

Sure.

#17 @imath
5 years ago

  • Milestone changed from Up Next to 6.0.0

Move the first tickets to next major release.

@imath
5 years ago

#18 @imath
5 years ago

  • Component changed from Activity to Administration
  • Keywords has-patch reporter-feedback added; needs-patch dev-feedback removed
  • Owner set to slaFFik

@bhargavbhandari90 could you review/test 7526.2.patch ?

I've suggested some improvements in it like avoiding querying database if we don't need to.

Thanks in advance for your help. If that's ok for you I'll commit it asap.

#19 @bhargavbhandari90
5 years ago

Hi @imath,

Thanks for the patch. I've tested and it's working as expected.

Sorry for the late response.

#20 @imath
5 years ago

  • Resolution set to fixed
  • Status changed from new to closed

In 12551:

Add the total items amount in Activity and Groups Admin List Tables

The "All" view of the corresponding administration screens is now including the total amount of items between parenthesis.

Props bhargavbhandari90, DJPaul, Hnla

Fixes #7526

Note: See TracTickets for help on using tickets.