summaryrefslogtreecommitdiff
path: root/list_components.php
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-06-21 09:35:06 +0100
committerLester Caine <lester@lsces.co.uk>2026-06-21 09:35:06 +0100
commitc3608912295032da3733e41d04a4dc5ee49b3cc8 (patch)
tree7630342b259f7c73c650973e17ef8468c94de6a1 /list_components.php
parentdf3841bcb4dc82103d3fca46a4257446680bb51a (diff)
downloadstock-c3608912295032da3733e41d04a4dc5ee49b3cc8.tar.gz
stock-c3608912295032da3733e41d04a4dc5ee49b3cc8.tar.bz2
stock-c3608912295032da3733e41d04a4dc5ee49b3cc8.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'list_components.php')
-rw-r--r--list_components.php4
1 files changed, 2 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;
}