# Dashboard New Posts statistics broken

**URL:** https://meta.discourse.org/t/dashboard-new-posts-statistics-broken/352599
**Category:** Bug
**Created:** [February 16, 2025, 9:43pm UTC](https://meta.discourse.org/t/dashboard-new-posts-statistics-broken/352599 "2025-02-16T21:43:11Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Roi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roi/32/130587_2.png) [@Roi](https://meta.discourse.org/u/Roi)
#### Post date: [February 16, 2025, 9:43pm UTC](https://meta.discourse.org/t/dashboard-new-posts-statistics-broken/352599/1 "2025-02-16T21:43:11Z")

</div>

Hi all,

since one of the last upgrades one or two weeks ago the new posts statistics on the dashboard is broken here. It does not show anything anymore. Is this a problem just for me or a common bug? I did not find anything through search here.

Regards

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [February 16, 2025, 10:34pm UTC](https://meta.discourse.org/t/dashboard-new-posts-statistics-broken/352599/2 "2025-02-16T22:34:02Z")

</div>

Sorry, can you clarify, are you saying these graphs are not working?

 ![The image shows two line graphs comparing the count of topics and posts on a platform from January 6 to February 13, with peaks around January 25 and fluctuations in both metrics. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/e/d/0/ed081971000884f27244c5ca6b7044b75c484439.png)

When did you update your instance last, can you update it now?

---

<div class="post-metadata">

### Author: ![Roi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roi/32/130587_2.png) [@Roi](https://meta.discourse.org/u/Roi)
#### Post date: [February 16, 2025, 10:46pm UTC](https://meta.discourse.org/t/dashboard-new-posts-statistics-broken/352599/3 "2025-02-16T22:46:04Z")

</div>

Sorry for being unclear, here is a screenshot:

 ![This image is a mobile app screen showing a summary of daily contributions and calorie intake, with sections labeled "Beginn," "Neue Mitwirkende," "DeepMind - Key," and "Beiträge," and a message indicating no data has been recorded for one of the sections. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/f/7/3/f73fc9617cd5432a9b75eac5bd9aab13206f62ce.jpeg)

I updated this evening to [05685d430f](https://github.com/discourse/discourse/commits/05685d430f6d03a4d16c4aa3c87de5b5d725416f).

If I recall right, it is for about one of two weeks now, I upgrade every five days per so at the moment.

And yeah, not much traffic at the moment, but we have new posts. 😉 I also clicked and chose the year since today. Nothing there either.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [February 16, 2025, 10:53pm UTC](https://meta.discourse.org/t/dashboard-new-posts-statistics-broken/352599/4 "2025-02-16T22:53:11Z")

</div>

The first thing that springs to mind is “not enough data”, but let me mention this to the staff xp team who can help debug.

---

<div class="post-metadata">

### Author: ![Roi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roi/32/130587_2.png) [@Roi](https://meta.discourse.org/u/Roi)
#### Post date: [February 16, 2025, 10:57pm UTC](https://meta.discourse.org/t/dashboard-new-posts-statistics-broken/352599/6 "2025-02-16T22:57:01Z")

</div>

Thank you! Another screenshot, where you can see that there are new topics. So there must be new posts, too. At least as many as topics (but for sure it’s more than that here 😉).

 ![The image shows a line graph titled "Themen" with fluctuating trend data over multiple dates and a message titled "Beiträge" stating "Keine Daten anzeigend." (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/a/7/0/a702885076abfce462e952dd04f672070f2d6112.jpeg)

---

<div class="post-metadata">

### Author: ![martin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin/32/491371_2.png) [@martin](https://meta.discourse.org/u/martin)
#### Post date: [February 17, 2025, 1:46am UTC](https://meta.discourse.org/t/dashboard-new-posts-statistics-broken/352599/7 "2025-02-17T01:46:03Z")

</div>

If you go to the full report page at [https://YOURSITE.COM/admin/reports/posts?end\_date=2025-02-17&start\_date=2025-01-17](https://YOURSITE.COM/admin/reports/posts?end_date=2025-02-17&start_date=2025-01-17) can you get it to show you any data, adjusting the dates/filters? Do you see any errors in the logs at [https://YOURSITE.COM/logs](https://YOURSITE.COM/logs) or in the Chrome DevTools Network tab when loading this page or the dashboard?

---

<div class="post-metadata">

### Author: ![Roi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roi/32/130587_2.png) [@Roi](https://meta.discourse.org/u/Roi)
#### Post date: [February 17, 2025, 11:15am UTC](https://meta.discourse.org/t/dashboard-new-posts-statistics-broken/352599/8 "2025-02-17T11:15:09Z")

</div>

> [@martin](#):
>
> If you go to the full report page at [yoursite.com](https://YOURSITE.COM/admin/reports/posts?end_date=2025-02-17&start_date=2025-01-17) can you get it to show you any data, adjusting the dates/filters?

No, everything is empty there, too. I can also adjust start and end dates, not change.

 ![The screenshot is of a data import interface with a message indicating that no data has been imported in the current session and buttons for incremental, daily, and monthly import options, along with import dates and category selection. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/5/c/5/5c5406e0b12e87ffb977a9e6cfde053ab5de22e1.png)

> [@martin](#):
>
> Do you see any errors in the logs at [yoursite.com](https://YOURSITE.COM/logs)

No, none. Just some deprecation notices, not related to the stats (according to the time).

> [@martin](#):
>
> or in the Chrome DevTools Network tab when loading this page or the dashboard?

Indeed, there are errors. When I load the page, it’s 9, getting more after time.

 ![The image displays a console log with various error messages related to scripting and fetching issues in the Chrome DevTools, such as "Uncaught TypeError", "Cannot find page" errors, as well as an example of a script being executed and some managed resources and restrictions. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/d/0/1/d01c19097eca62f6fe8d74696a576516f7afa604.png)

Does this help? Shall I copy-paste (text) one/all of these errors?

---

<div class="post-metadata">

### Author: ![qingfeng1024](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/qingfeng1024/32/495412_2.png) [@qingfeng1024](https://meta.discourse.org/u/qingfeng1024)
#### Post date: [February 17, 2025, 11:27am UTC](https://meta.discourse.org/t/dashboard-new-posts-statistics-broken/352599/9 "2025-02-17T11:27:20Z")

</div>

Indeed, I have encountered this situation as well.My community also fails to display the correct post count.

---

<div class="post-metadata">

### Author: ![Roi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roi/32/130587_2.png) [@Roi](https://meta.discourse.org/u/Roi)
#### Post date: [February 17, 2025, 2:42pm UTC](https://meta.discourse.org/t/dashboard-new-posts-statistics-broken/352599/10 "2025-02-17T14:42:51Z")

</div>

> [@shannon1024](#):
>
> My community also fails to display the correct post count.

Not correct or nothing at all like here?

---

<div class="post-metadata">

### Author: ![martin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin/32/491371_2.png) [@martin](https://meta.discourse.org/u/martin)
#### Post date: [February 18, 2025, 1:12am UTC](https://meta.discourse.org/t/dashboard-new-posts-statistics-broken/352599/11 "2025-02-18T01:12:27Z")

</div>

Did a little research, it seems like the `domQueryService` errors are from the Bitwarden Chrome extension, they are unlikely to cause issues. The mini-profiler errors can be ignored.

The fingerprint-report error is from [GitHub - discourse/discourse-fingerprint: A plugin that computes user fingerprints to help administrators combat internet trolls. · GitHub](https://github.com/discourse/discourse-fingerprint), and while it is an issue that we need to fix it doesn’t seem to prevent the Posts report from loading for me locally.

That body\_tag\_1.js file other people seem to have issues with sometimes on Discourse [Lost ability to scroll through HA community site - community-feedback - Home Assistant Community](https://community.home-assistant.io/t/lost-ability-to-scroll-through-ha-community-site/659707) . Do you have any Adblockers? If so try disabling them. If not or that doesn’t work, try enabling [Safe Mode](https://meta.discourse.org/t/53504?silent=true) [Using Safe Mode to troubleshoot issues with themes and plugins](https://meta.discourse.org/t/using-safe-mode-to-troubleshoot-issues-with-themes-and-plugins/53504) and seeing if you can load the page, if you can that would indicate a plugin or theme issue.

Finally, try loading the JSON for the report and see if you get any results here:

[https://YOURSITE.COM/admin/reports/bulk.json?reports[posts][facets][]=prev\_period&reports[posts][start\_date]=2025-01-18&reports[posts][end\_date]=2025-02-18&reports[posts][limit]=50](https://YOURSITE.COM/admin/reports/bulk.json?reports%5Bposts%5D%5Bfacets%5D%5B%5D=prev_period&reports%5Bposts%5D%5Bstart_date%5D=2025-01-18&reports%5Bposts%5D%5Bend_date%5D=2025-02-18&reports%5Bposts%5D%5Blimit%5D=50)

---

<div class="post-metadata">

### Author: ![Roi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roi/32/130587_2.png) [@Roi](https://meta.discourse.org/u/Roi)
#### Post date: [February 20, 2025, 9:03pm UTC](https://meta.discourse.org/t/dashboard-new-posts-statistics-broken/352599/12 "2025-02-20T21:03:12Z")

</div>

> [@martin](#):
>
> Do you have any Adblockers? If so try disabling them.

I have, what’s already in Opera, which is the browser I am using on the computer. I also use Pi-hole with several blocklists.

But: These problems also occur on my iPad in the Discourse app and in other networks, including mobile data. So no ad blockers or anything like that.

> [@martin](#):
>
> If not or that doesn’t work, try enabling [Safe Mode](https://meta.discourse.org/t/53504?silent=true) [Using Safe Mode to troubleshoot issues with themes and plugins](https://meta.discourse.org/t/using-safe-mode-to-troubleshoot-issues-with-themes-and-plugins/53504) and seeing if you can load the page, if you can that would indicate a plugin or theme issue.

I can, but not today anymore. 😉

> [@martin](#):
>
> Finally, try loading the JSON for the report and see if you get any results here:
> 
> [https://YOURSITE.COM/admin/reports/bulk.json?reports[posts][facets][]=prev\_period&reports[posts][start\_date]=2025-01-18&reports[posts][end\_date]=2025-02-18&reports[posts][limit]=50](https://YOURSITE.COM/admin/reports/bulk.json?reports%5Bposts%5D%5Bfacets%5D%5B%5D=prev_period&reports%5Bposts%5D%5Bstart_date%5D=2025-01-18&reports%5Bposts%5D%5Bend_date%5D=2025-02-18&reports%5Bposts%5D%5Blimit%5D=50)

Sure:

`{"reports":[{"type":"posts","title":"Beiträge","xaxis":"Tag","yaxis":"Anzahl neuer Beiträge","description":"Neue Beiträge, die in dieser Zeit erstellt wurden","description_link":null,"data":[],"start_date":"2025-01-18T00:00:00Z","end_date":"2025-02-18T23:59:59Z","prev_data":null,"prev_start_date":"2024-12-17T00:00:00Z","prev_end_date":"2025-01-18T00:00:00Z","prev30Days":null,"dates_filtering":true,"report_key":"reports:posts:20250118:20250218:[:prev_period]:50:4","primary_color":"rgba(113,184,254,1)","secondary_color":"rgba(113,184,254,0.1)","available_filters":[{"id":"category","type":"category","default":null}],"labels":[{"type":"date","property":"x","title":"Tag"},{"type":"number","property":"y","title":"Anzahl"}],"average":false,"percent":false,"higher_is_better":true,"modes":["chart","table"],"prev_period":0,"limit":50}]}`

As this does not show anything, if I read this right, does the [safe mode](https://meta.discourse.org/t/53504?silent=true) make sense?

---

<div class="post-metadata">

### Author: ![martin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin/32/491371_2.png) [@martin](https://meta.discourse.org/u/martin)
#### Post date: [February 21, 2025, 3:43am UTC](https://meta.discourse.org/t/dashboard-new-posts-statistics-broken/352599/13 "2025-02-21T03:43:46Z")

</div>

Okay thank you, that is helpful and it indicates that the data itself is missing, and not that there is some error on the frontend 🤔

The SQL query that backs this report is fairly simple, if you have access to [Data Explorer](https://meta.discourse.org/t/32566?silent=true) or directly to your DB you can try running and tweaking this and see if it will give you any data:

```sql
SELECT 
  COUNT(*) AS "count_all", 
  date(posts.created_at) AS "date_posts_created_at" 
FROM 
  "posts" 
  INNER JOIN "topics" ON "topics"."deleted_at" IS NULL 
  AND "topics"."id" = "posts"."topic_id" 
WHERE 
  "posts"."deleted_at" IS NULL 
  AND (
    topics.archetype <> 'private_message'
  ) 
  AND (
    posts.created_at >= '2025-02-01' 
    AND posts.created_at <= '2025-02-28'
  ) 
  AND "posts"."post_type" = 1 
GROUP BY 
  date(posts.created_at) 
ORDER BY 
  date(posts.created_at)

```

And here is the report code itself:

> <https://github.com/discourse/discourse/blob/8596aa34c46071eb42ffbb9e19ad733d1765578e/app/models/concerns/reports/posts.rb#L7-L32>

I’m afraid it’s kind of tricky to debug this further without having access to your site so I can dig around the database.

---

<div class="post-metadata">

### Author: ![Roi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roi/32/130587_2.png) [@Roi](https://meta.discourse.org/u/Roi)
#### Post date: [February 21, 2025, 8:35am UTC](https://meta.discourse.org/t/dashboard-new-posts-statistics-broken/352599/14 "2025-02-21T08:35:19Z")

</div>

> [@martin](#):
>
> The SQL query that backs this report is fairly simple, if you have access to [Data Explorer](https://meta.discourse.org/t/32566?silent=true) or directly to your DB you can try running and tweaking this and see if it will give you any data

The query in [Data Explorer](https://meta.discourse.org/t/32566?silent=true) comes back with data:

 ![The image displays a table with a count of posts created at dates from February 1 to February 6, 2025, with 19 posts created in 6.2 ms as of the last update. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/7/2/1/7211b19207a6681ed33e90dff4710b83f4109cee.png)

---

<div class="post-metadata">

### Author: ![martin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin/32/491371_2.png) [@martin](https://meta.discourse.org/u/martin)
#### Post date: [February 28, 2025, 12:08am UTC](https://meta.discourse.org/t/dashboard-new-posts-statistics-broken/352599/15 "2025-02-28T00:08:44Z")

</div>

Sorry Roi, this got a bit lost in the cracks. I guess there must be something wrong with the report code itself? [discourse/app/models/concerns/reports/posts.rb at 8596aa34c46071eb42ffbb9e19ad733d1765578e · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/8596aa34c46071eb42ffbb9e19ad733d1765578e/app/models/concerns/reports/posts.rb#L7-L32) .

Do you have access to the rails console of your site? If so try this and see if it gives you any data:

```ruby
Report.find("posts", start_date: 4.weeks.ago, end_date: Time.zone.now).data

```

This will also output the SQL queries it runs, so might be some further clues there.

---

<div class="post-metadata">

### Author: ![Roi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roi/32/130587_2.png) [@Roi](https://meta.discourse.org/u/Roi)
#### Post date: [February 28, 2025, 2:32pm UTC](https://meta.discourse.org/t/dashboard-new-posts-statistics-broken/352599/16 "2025-02-28T14:32:09Z")

</div>

> [@martin](#):
>
> Sorry Roi, this got a bit lost in the cracks.

No worries! It does not look perfect on the admin dashboard, but it is not that critical like other bugs.

> [@martin](#):
>
> Do you have access to the rails console of your site?

Yes.

> [@martin](#):
>
> This will also output the SQL queries it runs, so might be some further clues there.

Hm, was I doing this right?

```plaintext
root@prometheus-discourse-sidemount:/var/www/discourse# rails c
Plugin name is 'discourse-docs', but plugin directory is named 'discourse-knowledge-explorer'
Plugin name is 'discourse-user-notes', but plugin directory is named 'discourse-staff-notes'
[1] pry(main)> Report.find("posts", start_date: 4.weeks.ago, end_date: Time.zone.now).data
=> []
[2] pry(main)>

```

The answer is empty. That would explain the empty box on the admin dashboard. But your wrote that there should be an SQL statement in the answer as well?

---

<div class="post-metadata">

### Author: ![martin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin/32/491371_2.png) [@martin](https://meta.discourse.org/u/martin)
#### Post date: [March 3, 2025, 1:11am UTC](https://meta.discourse.org/t/dashboard-new-posts-statistics-broken/352599/17 "2025-03-03T01:11:51Z")

</div>

> [@Roi](#):
>
> The answer is empty. That would explain the empty box on the admin dashboard. But your wrote that there should be an SQL statement in the answer as well?

Ah sorry maybe I only saw it because I was running it locally. Try this:

```ruby
MethodProfiler.output_sql_to_stderr!
Report.find("posts", start_date: 4.weeks.ago, end_date: Time.zone.now).data

```

You will get a lot more noise of queries now, but the last few queries will be the ones from the report:

 ![image](https://global.discourse-cdn.com/meta/original/4X/d/5/b/d5b32d26259c2bab436297396432a416bb1d18d9.png)

---

<div class="post-metadata">

### Author: ![Roi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roi/32/130587_2.png) [@Roi](https://meta.discourse.org/u/Roi)
#### Post date: [March 3, 2025, 6:03am UTC](https://meta.discourse.org/t/dashboard-new-posts-statistics-broken/352599/18 "2025-03-03T06:03:56Z")

</div>

Okay, a lot more noise. 😉 Is this what you are looking for or do you need more from above?

```plaintext
debugsql (sql): SELECT COUNT(*) AS "count_all", date(posts.created_at) AS "date_posts_created_at" FROM "posts" INNER JOIN "topics" ON "topics"."deleted_at" IS NULL AND "topics"."id" = "posts"."topic_id" WHERE "posts"."deleted_at" IS NULL AND (topics.archetype <> 'private_message') AND NOT ((topics.category_id IN (NULL))) AND (posts.created_at >= '2025-02-03 06:00:45.160432' AND posts.created_at <= '2025-03-03 06:00:45.160586') AND "posts"."post_type" = 1 GROUP BY date(posts.created_at) ORDER BY date(posts.created_at)
debugsql (sec): 0.001
debugsql (sql): SELECT "category_custom_fields"."category_id" FROM "category_custom_fields" WHERE "category_custom_fields"."name" = 'private_topics_enabled'
debugsql (sec): 0.0
debugsql (sql): SELECT COUNT(*) FROM "posts" INNER JOIN "topics" ON "topics"."deleted_at" IS NULL AND "topics"."id" = "posts"."topic_id" WHERE "posts"."deleted_at" IS NULL AND (topics.archetype <> 'private_message') AND NOT ((topics.category_id IN (NULL))) AND "posts"."post_type" = 1
debugsql (sec): 0.0
debugsql (sql): SELECT COUNT(*) FROM "posts" INNER JOIN "topics" ON "topics"."deleted_at" IS NULL AND "topics"."id" = "posts"."topic_id" WHERE "posts"."deleted_at" IS NULL AND (topics.archetype <> 'private_message') AND NOT ((topics.category_id IN (NULL))) AND "posts"."post_type" = 1 AND (posts.created_at >= '2025-01-04 06:00:45.160432' and posts.created_at < '2025-02-03 06:00:45.160432')
debugsql (sec): 0.0
debugsql (sql): COMMIT
debugsql (sec): 0.0
=> []

```

---

<div class="post-metadata">

### Author: ![martin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin/32/491371_2.png) [@martin](https://meta.discourse.org/u/martin)
#### Post date: [March 5, 2025, 1:04am UTC](https://meta.discourse.org/t/dashboard-new-posts-statistics-broken/352599/19 "2025-03-05T01:04:52Z")

</div>

Yes that is what I need 🙂 The part that jumps out at me is `AND NOT ((topics.category_id IN (NULL)))`; I don’t have that in the query I show in the screenshot above. This would exclude all topics without a category from the count, which depending on your forum setup could be a lot?

I’m not seeing in the code where that comes from. Next step I would try doing this in [Data Explorer](https://meta.discourse.org/t/32566?silent=true):

```sql
SELECT 
  COUNT(*) AS "count_all", 
  date(posts.created_at) AS "date_posts_created_at" 
FROM 
  "posts" 
  INNER JOIN "topics" ON "topics"."deleted_at" IS NULL 
  AND "topics"."id" = "posts"."topic_id" 
WHERE 
  "posts"."deleted_at" IS NULL 
  AND (
    topics.archetype <> 'private_message'
  ) 
  AND (
    posts.created_at >= '2025-02-03 06:00:45.160432' 
    AND posts.created_at <= '2025-03-03 06:00:45.160586'
  ) 
  AND "posts"."post_type" = 1 
GROUP BY 
  date(posts.created_at) 
ORDER BY 
  date(posts.created_at)

```

(I removed the `AND NOT` clause here), and seeing if you get any result. If I run this locally I get:

```plaintext
 count_all | date_posts_created_at
-----------+-----------------------
         1 | 2025-02-03
         8 | 2025-02-04
         7 | 2025-02-05
         1 | 2025-02-06
         7 | 2025-02-12
         4 | 2025-02-26

```

Whereas if I keep the `category_id` clause your queries are showing I get no data.

---

<div class="post-metadata">

### Author: ![Roi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roi/32/130587_2.png) [@Roi](https://meta.discourse.org/u/Roi)
#### Post date: [March 5, 2025, 1:41am UTC](https://meta.discourse.org/t/dashboard-new-posts-statistics-broken/352599/20 "2025-03-05T01:41:50Z")

</div>

Works:

 ![The image contains a list of dates arranged in two columns, with specific numerical values above each date. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/4/a/a/4aa0768b261426e114ce2855f4394776ac1b517b.jpeg)

🤘

> [@martin](#):
>
> The part that jumps out at me is `AND NOT ((topics.category_id IN (NULL)))`; I don’t have that in the query I show in the screenshot above. This would exclude all topics without a category from the count, which depending on your forum setup could be a lot?

All our posts have a category.

Where is this additional condition coming from? 🤔

---

<div class="post-metadata">

### Author: ![martin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin/32/491371_2.png) [@martin](https://meta.discourse.org/u/martin)
#### Post date: [March 6, 2025, 2:51am UTC](https://meta.discourse.org/t/dashboard-new-posts-statistics-broken/352599/21 "2025-03-06T02:51:30Z")

</div>

> [@Roi](#):
>
> Where is this additional condition coming from? 🤔

Yeah I’m really not sure ☹ Long shot but it could possibly be a plugin adding/modifying something? 🤔 What plugins do you use? The first query above (the one with `count_all`) comes from here:

> <https://github.com/discourse/discourse/blob/9730ca947f2b2ca83706149a0b5d07d7cc40c257/app/models/post.rb#L947-L977>

If just calling this in the console still adds that `category_id IN (NULL)` clause, then something is very weird:

```ruby
Post.public_posts_count_per_day(4.weeks.ago, Time.zone.now)

```

[Next page](https://meta.discourse.org/t/dashboard-new-posts-statistics-broken/352599.md?page=2)
