Skip to:
Content

BuddyPress.org

Opened 2 years ago

Last modified 2 weeks ago

#7526 new enhancement

Counter for "All" tab for activity and groups table

Reported by: bhargavbhandari90 Owned by:
Milestone: 6.0.0 Priority: normal
Severity: normal Version: 2.8.2
Component: Activity Keywords: has-screenshots needs-patch dev-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 (6)

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

Download all attachments as: .zip

Change History (23)

@bhargavbhandari90
2 years ago

It should be like this.

@bhargavbhandari90
2 years ago

We should add the counter for consistency

@bhargavbhandari90
2 years ago

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

#1 @bhargavbhandari90
2 years ago

  • Keywords has-patch has-screenshots added

#2 @bhargavbhandari90
2 years ago

  • Cc bn.bhandari90@… added

#3 @bhargavbhandari90
2 years ago

  • Milestone changed from Awaiting Review to 2.9

#4 @hnla
2 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
2 years ago

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

#6 @hnla
2 years ago

BuddyPress slack channel @19:00hrs UTC

Version 0, edited 2 years ago by hnla (next)

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


2 years ago

#8 @DJPaul
2 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
23 months 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.


23 months ago

#11 follow-up: @DJPaul
23 months 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
23 months 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 23 months ago by bhargavbhandari90 (previous) (diff)

#13 follow-up: @DJPaul
22 months ago

Did you get anywhere with this @bhargavbhandari90 ?

@bhargavbhandari90
3 weeks ago

Used total_activity_count

#14 in reply to: ↑ 13 @bhargavbhandari90
3 weeks 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
3 weeks ago

For group counter

#15 follow-up: @imath
3 weeks 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
2 weeks 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
2 weeks ago

  • Milestone changed from Up Next to 6.0.0

Move the first tickets to next major release.

Note: See TracTickets for help on using tickets.