From ff5a2055d2ad8a5bd83c809d75fcf7f21bf0817b Mon Sep 17 00:00:00 2001 From: Zuzanna Date: Thu, 2 Oct 2025 10:48:50 +0200 Subject: [PATCH] other question types in section can be added --- www/form/inner.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/www/form/inner.js b/www/form/inner.js index 653b13395..7941f0d5b 100644 --- a/www/form/inner.js +++ b/www/form/inner.js @@ -3865,7 +3865,13 @@ define([ var idx = content.order.indexOf(uid); if (!full) { if (inSection) { - var section = content.form[uid]; + if (content.form[uid].type === 'section') { + var section = content.form[uid]; + } else { + var $el = $container.find(`[data-id="${uid}"]`); + var sectionUid = $el.parents('.cp-form-block').attr('data-id'); + var section = content.form[sectionUid]; + } section.opts = section.opts || STATIC_TYPES.section.opts; arr = section.opts.questions; } else { @@ -3937,7 +3943,7 @@ define([ $container.find('.cp-form-block:not(.cp-form-submit-message)').each(function (i, el) { var $el = $(el); var uid = $el.attr('data-id'); - var inSection = ($(el.parentElement).attr('class').indexOf('section') !== -1) ? true : false; + var inSection = !content.order.includes(uid); $el.before(getFormCreator(uid, inSection)); }); // Add to the end of a section