From ca543659c95899bc77860288fe2cd2a265bd7fb0 Mon Sep 17 00:00:00 2001 From: Ryan Lerch Date: Jun 26 2018 05:10:22 +0000 Subject: Fix messed up custom fields in settings The new tabbed layout of the settings page changed the way we add rows to some of the settings that use rows, like priorities and the custom fields. This new way used a hidden blank-field that allowed us to duplicate. However, this field was sticking around when submitting the form, and was causing the custom fields to not be submitted propertly to the post call. This PR uses javascript to remove the hidden field from the form before it is submitted. Relates to #3366 Signed-off-by: Ryan Lerch --- diff --git a/pagure/templates/settings.html b/pagure/templates/settings.html index 37fd681..cdb8bf5 100644 --- a/pagure/templates/settings.html +++ b/pagure/templates/settings.html @@ -1300,6 +1300,10 @@ $('#accordions').on('shown.bs.collapse', function (e) { return false; }) +$("form").submit(function(){ + $(this).find(".blank-field").remove(); +}); + $('#accordions').on('hide.bs.collapse', function (e) { $(e.target).siblings().find("#dropdowncaret").attr('data-glyph', "caret-right"); })