From 59c6f9d28a7bfc08c2d92bd0daede80d5d457b39 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Tue, 18 Apr 2023 16:32:34 +0100 Subject: [PATCH] Fixed member count for limit checks when publishing sometimes being incorrect (#16667) no issue - the members stats service was being used for the total member count when checking member limits for publishing but the stats service is not always correct which could result in publishing being blocked unexpectedly - switched to using the total count from a `/members/` query which should always be correct/match other counts within the UI --- ghost/admin/app/services/limit.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ghost/admin/app/services/limit.js b/ghost/admin/app/services/limit.js index 22f3a456ee..2a9f3fbec0 100644 --- a/ghost/admin/app/services/limit.js +++ b/ghost/admin/app/services/limit.js @@ -93,9 +93,10 @@ export default class LimitsService extends Service { } async getMembersCount() { - const counts = await this.membersStats.fetchCounts(); + const members = await this.store.query('member', {limit: 'all'}); + const total = members.meta.pagination.total; - return counts.total; + return total; } async getNewslettersCount() {