# حساب topic\_count غير صحيح

**URL:** <https://meta.discourse.org/t/calculation-of-topic-count-incorrect/191395>\
**Category:** Bug\
**Created:** [23 مايو 2021، 7:50م UTC](https://meta.discourse.org/t/calculation-of-topic-count-incorrect/191395 "2021-05-23T19:50:24Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![fkohrt](https://avatars.discourse-cdn.com/v4/letter/f/6de8d8/32.png) [@fkohrt](https://meta.discourse.org/u/fkohrt)\
**Post date:** [23 مايو 2021، 7:50م UTC](https://meta.discourse.org/t/calculation-of-topic-count-incorrect/191395/1 "2021-05-23T19:50:24Z")

</div>

لاحظت خللاً حيث لا تُحسب المواضيع الموجودة فقط في فئة أب ضمن `topic_count` الخاص بـ API.

المنتدى المعني، الذي أستخدمه، يعمل بإصدار Discourse v2.4.0.beta11، لذا أتخيل أن هذا الخلل قد يكون قد تم إصلاحه في الإصدارات الأحدث، ولكن في حال لم يكن كذلك، إليك التقرير.

يتشابه هيكل المنتدى مع ما يلي، حيث أن الفئتين B و C هما فئتان تابعتان لـ A:

```plaintext
    Forum
    ├── ...
    ├── Category A (n=0)
    │ ├── Category B (n=92)
    │ └── Category C (n=6)
    └── ...

```

لقد كتبت قيمة `topic_count` (من `/c/xx/show.json`) وفقًا لـ API بعد كل فئة. ولكن في الواقع، يوجد موضوع واحد فقط في الفئة A، على الرغم من أن `topic_count` يُظهر صفرًا. وبناءً على ذلك، فإن `topics_all_time` (من `categories.json`) للفئة A يُظهر 98، بينما يُظهر تصفح `topic_list` (من `/c/xx.json`) أيضًا 99.

يمكنني أيضًا مشاركة تفاصيل حول المنتدى المعني عبر الرسائل الخاصة، في حال كان ذلك مفيدًا.

---

_[View the full topic](https://meta.discourse.org/t/calculation-of-topic-count-incorrect/191395)._
