Opened 7 years ago
Closed 5 years ago
#7526 closed enhancement (fixed)
Counter for "All" tab for activity and groups table
Reported by: | bhargavbhandari90 | Owned by: | 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)
Change History (27)
#4
@
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
@
7 years ago
@hnla Thank you. Let me know when you do dev chat. I would like to take part into this.
#6
@
7 years ago
BuddyPress slack channel @ 19:00hrs UTC
This ticket was mentioned in Slack in #buddypress by hnla. View the logs.
7 years ago
#8
@
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
@
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:
↓ 12
@
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
@
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 atotal_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
#14
in reply to:
↑ 13
@
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.
#15
follow-up:
↓ 16
@
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
@
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
@
5 years ago
- Milestone changed from Up Next to 6.0.0
Move the first tickets to next major release.
#18
@
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.
It should be like this.