@@ -159,7 +159,8 @@ public function index($Page = false) {
159159 $ categoryIDs = $ this ->getCategoryIDs ();
160160 // Fix to segregate announcement conditions until announcement caching has been reworked.
161161 // See https://github.com/vanilla/vanilla/issues/7241
162- $ where = $ announcementsWhere = [];
162+ $ where = ['Announce ' => 'all ' ];
163+ // Get Discussions and Announcements
163164 if ($ this ->data ('Followed ' )) {
164165 $ followedCategories = array_keys ($ categoryModel ->getFollowed (Gdn::session ()->UserID ));
165166 $ visibleCategoriesResult = CategoryModel::instance ()->getVisibleCategoryIDs (['filterHideDiscussions ' => true ]);
@@ -170,7 +171,7 @@ public function index($Page = false) {
170171 }
171172 $ where ['d.CategoryID ' ] = $ visibleFollowedCategories ;
172173 } elseif ($ categoryIDs ) {
173- $ where ['d.CategoryID ' ] = $ announcementsWhere [ ' d.CategoryID ' ] = CategoryModel::filterCategoryPermissions ($ categoryIDs );
174+ $ where ['d.CategoryID ' ] = CategoryModel::filterCategoryPermissions ($ categoryIDs );
174175 } else {
175176 $ visibleCategoriesResult = CategoryModel::instance ()->getVisibleCategoryIDs (['filterHideDiscussions ' => true ]);
176177 if ($ visibleCategoriesResult !== true ) {
@@ -189,11 +190,7 @@ public function index($Page = false) {
189190
190191 $ this ->setData ('CountDiscussions ' , $ CountDiscussions );
191192
192- // Get Announcements
193- $ this ->AnnounceData = $ Offset == 0 ? $ DiscussionModel ->getAnnouncements ($ announcementsWhere ) : false ;
194- $ this ->setData ('Announcements ' , $ this ->AnnounceData !== false ? $ this ->AnnounceData : [], true );
195-
196- // Get Discussions
193+ // Get Discussions and Announcements
197194 $ this ->DiscussionData = $ DiscussionModel ->getWhereRecent ($ where , $ Limit , $ Offset );
198195
199196 $ this ->setData ('Discussions ' , $ this ->DiscussionData , true );
0 commit comments