phpMyFAQ icon indicating copy to clipboard operation
phpMyFAQ copied to clipboard

Displaying the wrong number of FAQs

Open nicainicainicai opened this issue 3 years ago • 5 comments

Describe the bug When there is content under a subcategory of a category, the number of sub-category entries is displayed as 0

To Reproduce Steps to reproduce the behavior:

  1. Create a category by creating a subcategory under that category.
  2. Add FAQ under subcategory.
  3. View FAQ by all categories, subcategories show 0 answers.

Expected behavior Show the number of correct answers.

Screenshots 27526ccf024ff8fa8a66ab2a39ee741 71b9fc4baa72db20f1b115e8094fde8

**phpMyFAQ (please complete the following informat

  • phpMyFAQ version: 3.1.4
  • PHP version: 8.0.3
  • Database: MySQL 5.7
  • Elasticsearch: no

Desktop (please complete the following information):

  • OS: Windows 10 21H1
  • Browser Chrome 102

nicainicainicai avatar Jun 24 '22 04:06 nicainicainicai

I have the same issue, I have many more than 5 FAQs.

image

phpMyFAQ version 3.1.4 behind Windows IIS PHP 8.0 MySQL on Ubuntu 20.04 Elasticsearch on Ubuntu 20.04

Grunticus03 avatar Jun 25 '22 02:06 Grunticus03

Already fixed with https://github.com/thorsten/phpMyFAQ/issues/2128

thorsten avatar Jun 25 '22 09:06 thorsten

Thanks for your reply, the 3.1.5 version still has problems with me:

When the user is logged in, there is only one category where the number of answers is not 0. error2

When the user is not logged in, the number of answers for all categories is 0. error1

I tried commenting out the statements from line 407 to line 424 of CategoryHelper.php and the problem was solved. sloved1

Is there something wrong with my settings?

nicainicainicai avatar Jul 04 '22 02:07 nicainicainicai

@nicainicainicai What permission level do you use? user or groups? If you use groups, do you have groups defined?

thorsten avatar Jul 09 '22 11:07 thorsten

@thorsten

The permission level is basic.

phpMyFAQ has only one user created during installation. All categories and FAQs are created by this user.

nicainicainicai avatar Jul 11 '22 01:07 nicainicainicai

I found the issue while rewriting the category tree functionality, so it's fixed with the upcoming 3.2 release. It's related to #2292

thorsten avatar Jan 29 '23 10:01 thorsten