From a149fa37fc56044b8d9c97953196e53ac2c3b0e0 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 15 Feb 2022 10:37:14 -0500 Subject: [PATCH] Make filter debug modal work on non-saved filter --- web/ajax/modals/filterdebug.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/web/ajax/modals/filterdebug.php b/web/ajax/modals/filterdebug.php index f3a961874..d3ffaaf01 100644 --- a/web/ajax/modals/filterdebug.php +++ b/web/ajax/modals/filterdebug.php @@ -11,13 +11,20 @@ No filter id specified.'; - } else { - $filter = new ZM\Filter($_REQUEST['fid']); + + $filter = null; + if ($fid) { + $filter = new ZM\Filter($fid); if (!$filter->Id()) { echo '
Filter not found for id '.$_REQUEST['fid'].'
'; } + } else { + $filter = new ZM\Filter(); + if ( isset($_REQUEST['filter'])) { + $filter->set($_REQUEST['filter']); + } else { + echo '
No filter id or contents specified.
'; + } } ?>