From 57fa9f26fbb9a593ea8b1bc26458b5e079e1cdf6 Mon Sep 17 00:00:00 2001 From: Jay Collett <486430+jaycollett@users.noreply.github.com> Date: Thu, 9 Jul 2026 21:59:46 +0100 Subject: [PATCH] Fix checkbox config values always returning "1" Checkbox-type config options (e.g. ignore_tls) always tested as "1" regardless of the checkbox state. The Test-button config gatherer used $(this).val() for every .config-item, and jQuery .val() on a checkbox returns its value attribute ("1") regardless of checked state. App config blades pair a hidden input (0) with a checkbox (1) sharing the same data-config, and the checkbox is last in DOM order, so it always overwrote the value with "1". Normal form saves were unaffected. Use the :checked state for checkboxes so unchecking now tests as "0". Also rebuilds the committed compiled bundle (public/js/app.js) so the fix takes effect at runtime; the edit is byte-identical to the Laravel Mix development build output for this block. Fixes linuxserver/Heimdall-Apps#782 --- public/js/app.js | 7 ++++++- resources/assets/js/app.js | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/public/js/app.js b/public/js/app.js index e01bd0c8d..4d41224d4 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -4271,7 +4271,12 @@ $.when($.ready).then(function () { data.url = apiurl; $(".config-item").each(function () { var config = $(this).data("config"); - data[config] = $(this).val(); + // For checkboxes, use checked state instead of value attribute + if ($(this).is(":checkbox")) { + data[config] = $(this).is(":checked") ? "1" : "0"; + } else { + data[config] = $(this).val(); + } }); data.id = $("form[data-item-id]").data("item-id"); if (data.password && data.password === fakePassword) { diff --git a/resources/assets/js/app.js b/resources/assets/js/app.js index abe633d91..3a5286cde 100644 --- a/resources/assets/js/app.js +++ b/resources/assets/js/app.js @@ -310,7 +310,12 @@ $.when($.ready).then(() => { data.url = apiurl; $(".config-item").each(function () { const config = $(this).data("config"); - data[config] = $(this).val(); + // For checkboxes, use checked state instead of value attribute + if ($(this).is(":checkbox")) { + data[config] = $(this).is(":checked") ? "1" : "0"; + } else { + data[config] = $(this).val(); + } }); data.id = $("form[data-item-id]").data("item-id");