[Sprint/PinkPanther](fix): Refactored logic for moderation queue to not query Cassandra for post count.
Summary
Closes #1031
Currently on the production stack, if you moderate an older group, you will likely have posts still counted in your moderation queue, showing "4 posts unapproved", when you click, there is none.
Testing
This should be tested on a subdomain connected to production. If you do not have access to such a group ask me, and I will arrange that.
0/1
thread resolved
added scoped labels
- Last updated by Ben Hayward
37 37 $feeds = Core\Di\Di::_()->get('Groups\Feeds'); 38 38 $feeds->setGroup($group); 39 39 40 $count = $feeds->count(); 40 $limit = isset($_GET['limit']) ? (int) $_GET['limit'] : 12; 41 $offset = isset($_GET['offset']) ? $_GET['offset'] : ''; 41 42 43 $result = $feeds->getAll([ 'limit' => $limit, 'offset' => $offset ]); 44 $activities = Factory::exportable($result['data']); 42 45 if (isset($pages[1]) && $pages[1] == 'count') { 43 46 return Factory::response([ 44 'adminqueue:count' => $count 47 'adminqueue:count' => count($activities) - Owner
This will only ever show 12 though?
- Developer
@markeharding I see what you mean. What do you prefer, taking the limit off the request on the front-end, finding a way to get the query to return the count correctly, or get rid of misindexed posts via script?
added scoped label and automatically removed label
closed