From 32ff50d5014acfeedaccf7d2a77749f57257afc5 Mon Sep 17 00:00:00 2001 From: jdarwood007 Date: Thu, 20 Jul 2023 15:42:52 -0700 Subject: [PATCH] Only delete board_permissions_view if we have modified the access This bug keeps reappearing in various ways. To reproduce this one, simply move a board. When you do, only the new position for the board is passed. Resulting in modifyBoard deleting the board_permissions_view data, but has no data to rebuild with. Simply modifying the board and saving again rebuilds the access. @sbulen, @live627, @BrickOzp, @albertlast can you all test this Related #7689 Related #7692 Related #7539 Related #7540 Related #5514 Related #5515 Related #5265 Related #5152 Related #5153 Related #4727 --- Sources/Subs-Boards.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Sources/Subs-Boards.php b/Sources/Subs-Boards.php index d62d5eb442..ca88b89840 100644 --- a/Sources/Subs-Boards.php +++ b/Sources/Subs-Boards.php @@ -672,13 +672,14 @@ function modifyBoard($board_id, &$boardOptions) ); // Before we add new access_groups or deny_groups, remove all of the old entries - $smcFunc['db_query']('', ' - DELETE FROM {db_prefix}board_permissions_view - WHERE id_board = {int:selected_board}', - array( - 'selected_board' => $board_id, - ) - ); + if (isset($boardOptions['access_groups']) || isset($boardOptions['deny_groups'])) + $smcFunc['db_query']('', ' + DELETE FROM {db_prefix}board_permissions_view + WHERE id_board = {int:selected_board}', + array( + 'selected_board' => $board_id, + ) + ); if ($board_permissions_inserts != array()) $smcFunc['db_insert']('insert',