Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Category count keeps getting out of step #5760

Open
Sophist-UK opened this issue Feb 21, 2018 · 15 comments
Open

Category count keeps getting out of step #5760

Sophist-UK opened this issue Feb 21, 2018 · 15 comments
Assignees
Milestone

Comments

@Sophist-UK
Copy link
Contributor

Steps to reproduce the issue

Regular need to run Tools / Recount Statistics / Recount Category Statistics because new topics are not being counted.

Joomla version: 3.8.4
Kunena version: 5.1 RC1 or 2 (now upgraded to RC3)
Php version: 7.1
Database version: 5.6

@810
Copy link
Member

810 commented Feb 21, 2018

i have this on my todo list for the cronjobs.

We have now a limit recount, because for support shared hostings.

I will add cronjob, so users can set it up on their hosting solutions.

@Sophist-UK
Copy link
Contributor Author

I don't understand - surely when a user does something we can update the stats without excess overhead.

Certainly other bbs like phpBB do immediate updating of stats and don't need a cron job.

@810
Copy link
Member

810 commented Feb 21, 2018

Maybe there is a issue with the counting, but i need to know which function doesn't work correctly.
The basic functions, adding/deleting is counting correct. so there must be somewhere else the issue.

If you can try to reproduce the issue, i can fix it.

phpbb is a standalone product, we are a extra plugin on joomla, if you have more integrations, you can easily reach the php memory limit, so we need to have in mind, that we don't use to much resources.

@Sophist-UK
Copy link
Contributor Author

Sophist-UK commented Feb 21, 2018

I use the Joomla extension Fabrik which does 1,000 more complex stuff - believe me, if Fabrik runs OK, then Kunena will too.

Anyway, we are not talking about integrations here - we are talking about Kunena simply keeping its own basic statistics up to date like how many topics there are in a category.

@sshcli
Copy link
Member

sshcli commented Feb 21, 2018

If you can try to reproduce the issue, i can fix it.

@Sophist-UK there is your solution

@810
Copy link
Member

810 commented Feb 21, 2018

i see one issue already with numPosts, when a category with approval, the topic stays correct, but the message count is counted more.

@Sophist-UK do you have categories with approval?

@Sophist-UK
Copy link
Contributor Author

I was just discussing this with my Kunena administrator / global moderator.

We also think it might be to do with a category requiring approvals - either on first post of a topic or if user edits the topic already approved and it needs re-approval.

@810
Copy link
Member

810 commented Feb 21, 2018

i couldn't find the issue, so i have added a small hack. it should be working correct now.

@810 810 closed this as completed Feb 21, 2018
@810 810 reopened this Feb 21, 2018
@Sophist-UK
Copy link
Contributor Author

@810 Can you please reopen this issue.,

My fault for not saying but the stats for the category were the topic count which was on the low side rather than the high side.

The "hack" seems to relate to post counts not topic counts, and avoids increasing the count if it is a non-moderator saving into a moderated category, which suggests that it avoids +1 when the post needs moderating. In other words it would fix an issue of category post counts being too high - whereas our issue is topic counts are too low.

There are several topic count use cases that need to be handled with moderated categories:

  1. Topic created by a non-moderator - count +0
  2. Approval by a moderator - count +1
  3. Edit of approved topic (which hides the topic until re-approved) - count -1
  4. Topic awaiting approval is edited (rather than approved) by a moderator - not sure whether this results in an approved topic (count + 1) or whether it remains waiting for approval (count +0).

The obvious place to put the fix to topic counts is in the delta() method which is specifically designed to decide how to adjust the category topic count.

I would be happy to try to code a fix, but that would be a big learning curve for me.

@Sophist-UK
Copy link
Contributor Author

Ok - we have done some testing on use case 3. above. Having run Tools / Recount Statistics / Recount Category Statistics a user edited an existing approved topic and the category topic count was adjusted -2!! Note: Not -1 as expected, but -2.

When a moderator re-approves the topic, the count is increase +1 - so net having edited and approved a topic is -1.

@inspry
Copy link

inspry commented Aug 22, 2018

Any plans to add the cron job option for recounting statistics? Our site seems to mostly keep up, but on occasion it gets off count and we would really like to avoid having to monitor this constantly. Thanks for any help on this.

@Sophist-UK
Copy link
Contributor Author

Did this issue ever get fixed?

@810
Copy link
Member

810 commented Aug 22, 2018

Its prepared for K6.0

@inspry
Copy link

inspry commented Aug 23, 2018

Hi there,

Thanks for the update on this. Look forward to having that feature then. Appreciate your quick response!

@810 810 self-assigned this Sep 10, 2018
@810 810 added 5.1 and removed 5.1 labels Sep 11, 2018
@810 810 added this to the 5.1.4 milestone Sep 11, 2018
@810 810 modified the milestones: 5.1.4, 5.1.6 Oct 14, 2018
@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity.

@810 810 modified the milestones: 5.1.6, 5.1.17 Apr 13, 2020
@810 810 modified the milestones: 5.1.17, 5.1.18 Jun 10, 2020
@xillibit xillibit modified the milestones: 5.1.18, 5.1.19 Jul 26, 2020
@xillibit xillibit added 5.2 and removed 5.1 labels Aug 14, 2020
@xillibit xillibit modified the milestones: 5.1.19, 5.2 Aug 14, 2020
@xillibit xillibit removed the 5.2 label Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants