Skip to:
Content

Opened 2 years ago

Last modified 17 months ago

#7526 new enhancement

Counter for "All" tab for activity and groups table

Reported by: bhargavbhandari90 Owned by:
Milestone: Awaiting Contributions 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 (4)

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.

Download all attachments as: .zip

Change History (17)

@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

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

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


2 years ago

#8 @DJPaul
22 months 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
18 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.


18 months ago

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

#13 @DJPaul
17 months ago

Did you get anywhere with this @bhargavbhandari90 ?

Note: See TracTickets for help on using tickets.