From b3092f2f591f97e453d7b7acf1e5843c5a1bb3c8 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 3 Feb 2022 17:31:37 -0500 Subject: [PATCH] Add special handling for skip_locked, as it is a checkbox. Don't update REQUEST['Id'] on execute so we can redirect to the original filter. --- web/includes/actions/filter.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/web/includes/actions/filter.php b/web/includes/actions/filter.php index 058a004ed..4f627b0b0 100644 --- a/web/includes/actions/filter.php +++ b/web/includes/actions/filter.php @@ -48,6 +48,7 @@ if (isset($_REQUEST['object']) and ($_REQUEST['object'] == 'filter')) { $_REQUEST['filter']['Query']['sort_field'] = validStr($_REQUEST['filter']['Query']['sort_field']); $_REQUEST['filter']['Query']['sort_asc'] = validStr($_REQUEST['filter']['Query']['sort_asc']); $_REQUEST['filter']['Query']['limit'] = validInt($_REQUEST['filter']['Query']['limit']); + $_REQUEST['filter']['Query']['skip_locked'] = isset($_REQUEST['filter']['Query']['skip_locked']) ? validInt($_REQUEST['filter']['Query']['skip_locked']) : 0; $_REQUEST['filter']['AutoCopy'] = empty($_REQUEST['filter']['AutoCopy']) ? 0 : 1; $_REQUEST['filter']['AutoCopyTo'] = empty($_REQUEST['filter']['AutoCopyTo']) ? 0 : $_REQUEST['filter']['AutoCopyTo']; @@ -80,21 +81,23 @@ if (isset($_REQUEST['object']) and ($_REQUEST['object'] == 'filter')) { $error_message = $filter->get_last_error(); return; } - // We update the request id so that the newly saved filter is auto-selected - $_REQUEST['Id'] = $filter->Id(); + if ($action == 'Save' or $action == 'SaveAs' ) { + // We update the request id so that the newly saved filter is auto-selected + $_REQUEST['Id'] = $filter->Id(); + } } # end if changes if ($action == 'execute') { $filter->execute(); if (count($changes)) { $filter->delete(); - $filter->Id(null); + $filter->Id($_REQUEST['Id']); } } else if ($filter->Background()) { $filter->control('start'); } global $redirect; - $redirect = '?view=filter'.$filter->querystring('filter', '&'); + $redirect = '?view=filter&Id='.$_REQUEST['Id'].$filter->querystring('filter', '&'); } else if ($action == 'control') { if ( $_REQUEST['command'] == 'start'