Skip to content

Commit 33b1d95

Browse files
Preserve ignored boards in User properties even if feature is disabled
Signed-off-by: Jon Stovell <jonstovell@gmail.com>
1 parent 2694d4b commit 33b1d95

4 files changed

Lines changed: 7 additions & 4 deletions

File tree

Sources/Actions/BoardIndex.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ public static function get(array $board_index_options): array
436436
$parent = Board::$loaded[$row_board['id_parent']] ?? null;
437437

438438
// Perhaps we are ignoring this board?
439-
$ignoreThisBoard = \in_array($row_board['id_board'], User::$me->ignoreboards);
439+
$ignoreThisBoard = !empty(Config::$modSettings['allow_ignore_boards']) && \in_array($row_board['id_board'], User::$me->ignoreboards);
440440
$row_board['is_read'] = !empty($row_board['is_read']) || $ignoreThisBoard ? '1' : '0';
441441

442442
if ($board_index_options['include_categories']) {

Sources/Actions/Calendar.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1511,7 +1511,10 @@ public static function cacheAdjustData(array &$cache_block, array &$params): voi
15111511
foreach ($cache_block['data']['calendar_events'] as $k => $event) {
15121512
// Remove events that the user may not see or wants to ignore.
15131513
if (
1514-
\in_array($event->id_board, User::$me->ignoreboards)
1514+
(
1515+
!empty(Config::$modSettings['allow_ignore_boards'])
1516+
&& \in_array($event->id_board, User::$me->ignoreboards)
1517+
)
15151518
|| (
15161519
\count(array_intersect(User::$me->groups, $event->allowed_groups)) === 0
15171520
&& !User::$me->allowedTo('admin_forum')

Sources/Actions/Search.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public function execute(): void
209209
}
210210
// User didn't select any boards, so select all except ignored and recycle boards.
211211
else {
212-
$board->selected = !$board->recycle && !\in_array($board->id, User::$me->ignoreboards);
212+
$board->selected = !$board->recycle && (empty(Config::$modSettings['allow_ignore_boards']) || !\in_array($board->id, User::$me->ignoreboards));
213213
}
214214

215215
if (!$board->selected && !$board->recycle) {

Sources/User.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2724,7 +2724,7 @@ public static function buildQueryBoard(int $id): array
27242724
// This will take the place of query_see_boards in certain spots, so it better include the boards they can see also
27252725

27262726
// If they aren't ignoring any boards then they want to see all the boards they can see
2727-
if (empty($ignoreboards)) {
2727+
if (empty(Config::$modSettings['allow_ignore_boards']) || empty($this->ignoreboards)) {
27282728
$query_part['query_wanna_see_board'] = $query_part['query_see_board'];
27292729
$query_part['query_wanna_see_message_board'] = $query_part['query_see_message_board'];
27302730
$query_part['query_wanna_see_topic_board'] = $query_part['query_see_topic_board'];

0 commit comments

Comments
 (0)