From c3608912295032da3733e41d04a4dc5ee49b3cc8 Mon Sep 17 00:00:00 2001 From: Lester Caine Date: Sun, 21 Jun 2026 09:35:06 +0100 Subject: Fix hide_kitlocker filter not persisting when unchecked Unchecked checkboxes send nothing in the GET request, so the default-on guard reset the filter every time. Add a hidden sentinel field so PHP can distinguish a fresh page load (apply default) from a form submission with the box deliberately unchecked. Co-Authored-By: Claude Sonnet 4.6 --- list_components.php | 4 ++-- templates/list_components.tpl | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/list_components.php b/list_components.php index 751cdcf..9bb68ac 100644 --- a/list_components.php +++ b/list_components.php @@ -22,8 +22,8 @@ if( !empty( $_REQUEST['find'] ) ) { $_REQUEST['search'] = $_REQUEST['find']; } -// Default on — hide pure kitlocker components; show those also supplied by kitlocker to elves -if( !isset( $_REQUEST['hide_kitlocker'] ) ) { +// Default on unless the filter form has been submitted (sentinel field present) +if( !isset( $_REQUEST['hide_kitlocker'] ) && empty( $_REQUEST['filter_submitted'] ) ) { $_REQUEST['hide_kitlocker'] = 1; } diff --git a/templates/list_components.tpl b/templates/list_components.tpl index f27d3b3..d9f6e76 100644 --- a/templates/list_components.tpl +++ b/templates/list_components.tpl @@ -6,6 +6,7 @@ {biticon ipackage="icons" iname="kt-add-filters" iexplain="Create Component"} {/if}
+
-- cgit v1.3