From 2a3660f2d161c2ee00ca63a87b0f94750da271dd Mon Sep 17 00:00:00 2001 From: Richard Schreiber Date: Thu, 16 Sep 2021 10:07:43 +0200 Subject: [PATCH] Fix -- copy answers even when matching customer profiles exist (#2209) --- .../templates/pretixpresale/event/checkout_questions.html | 4 ++-- src/pretix/static/pretixpresale/js/ui/main.js | 2 ++ src/pretix/static/pretixpresale/js/ui/questions.js | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pretix/presale/templates/pretixpresale/event/checkout_questions.html b/src/pretix/presale/templates/pretixpresale/event/checkout_questions.html index 3646b67bb..47f019338 100644 --- a/src/pretix/presale/templates/pretixpresale/event/checkout_questions.html +++ b/src/pretix/presale/templates/pretixpresale/event/checkout_questions.html @@ -50,7 +50,7 @@
{% if addresses_data %} -
+

@@ -160,7 +160,7 @@ {% endif %}

{% if profiles_data %} -
+

diff --git a/src/pretix/static/pretixpresale/js/ui/main.js b/src/pretix/static/pretixpresale/js/ui/main.js index e6ee82b2b..dc12feb96 100644 --- a/src/pretix/static/pretixpresale/js/ui/main.js +++ b/src/pretix/static/pretixpresale/js/ui/main.js @@ -481,10 +481,12 @@ $(function () { function copy_answers(elements, answers) { elements.not("[disabled], [readonly]").each(function (index) { + if (!this.name) return; var input = $(this), tagName = input.prop('tagName').toLowerCase(), attributeType = input.attr('type'), suffix = input.attr('name').split('-')[1]; + if (input.closest(".js-do-not-copy-answers").length) return; switch (tagName) { case "textarea": diff --git a/src/pretix/static/pretixpresale/js/ui/questions.js b/src/pretix/static/pretixpresale/js/ui/questions.js index 69f507a87..a8d645bd5 100644 --- a/src/pretix/static/pretixpresale/js/ui/questions.js +++ b/src/pretix/static/pretixpresale/js/ui/questions.js @@ -341,7 +341,7 @@ function questions_init_profiles(el) { var $checkboxContainer = $checkbox.closest(".form-group").addClass("profile-save"); var $help = $selectContainer.find(".help-block"); - var $container = $("

"); + var $container = $("
"); $selectContainer.after($container); $container.append($checkboxContainer); $container.append($selectContainer);