From cea02487c7f8facf7f4b3db5a7be1234403b3a48 Mon Sep 17 00:00:00 2001 From: Tammo ter Hark Date: Tue, 24 Nov 2026 23:23:59 +0100 Subject: [PATCH] fix(views): legacy guard for pre-Prompt-M DB rows without theme reset A DB row from before Prompt M still carries the old on/off keys (brandlogo/centerlogo/rightlogo). When the theme files are updated WITHOUT a theme reset, such a row (e.g. centerlogo=off with a non-empty old centerlogofile) would show that logo under the new file-only logic. The views now also honor the legacy key when present: logo == 'off' keeps the logo hidden (|default('on') after a reset, where the key is gone). Fresh installs are unaffected: all new keys have config.xml defaults and the views fall back via |default when keys are absent. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- views/layout_survey_list.twig | 2 +- views/subviews/header/custom_header.twig | 2 +- views/subviews/header/nav_bar.twig | 11 ++++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/views/layout_survey_list.twig b/views/layout_survey_list.twig index 4a2e067..4c8c4da 100644 --- a/views/layout_survey_list.twig +++ b/views/layout_survey_list.twig @@ -92,7 +92,7 @@ NOTE: Feel free to ask for functions, variables, etc, that you feel are missing {{ include('./subviews/header/head.twig') }} + class=" {{ aSurveyInfo.class.body }} font-{{ aSurveyInfo.options.font }} lang-{{ aSurveyInfo.languagecode }} {{ aSurveyInfo.surveyformat }} {% if( aSurveyInfo.options.brandlogofile|default('off') not in ['off', '', 'inherit'] and aSurveyInfo.options.brandlogo|default('on') != 'off') %}brand-logo{% endif %}" {{ aSurveyInfo.attr.body }} > {# This used for the pjax system #}
diff --git a/views/subviews/header/custom_header.twig b/views/subviews/header/custom_header.twig index 4843cb7..3251192 100644 --- a/views/subviews/header/custom_header.twig +++ b/views/subviews/header/custom_header.twig @@ -65,7 +65,7 @@ background-color: {{ aSurveyInfo.options.privacybackgroundcolor }}; } - {% if ( aSurveyInfo.options.brandlogofile|default('off') not in ['off', '', 'inherit'] ) %} + {% if ( aSurveyInfo.options.brandlogofile|default('off') not in ['off', '', 'inherit'] and aSurveyInfo.options.brandlogo|default('on') != 'off' ) %} body .top-container { margin-top: 0; } diff --git a/views/subviews/header/nav_bar.twig b/views/subviews/header/nav_bar.twig index 773b9d0..65bd351 100644 --- a/views/subviews/header/nav_bar.twig +++ b/views/subviews/header/nav_bar.twig @@ -54,9 +54,14 @@ For the survey navigator ("Next", "Back", etc.), see: navigation/navigator.twig {% set brandLogoFile = aSurveyInfo.options.brandlogofile|default('off') %} {% set centerLogoFile = aSurveyInfo.options.centerlogofile|default('off') %} {% set rightLogoFile = aSurveyInfo.options.rightlogofile|default('off') %} - {% set showBrandLogo = (brandLogoFile not in ['off', '', 'inherit'] and imageSrc(brandLogoFile)) %} - {% set showCenterLogo = (centerLogoFile not in ['off', '', 'inherit'] and imageSrc(centerLogoFile)) %} - {% set showRightLogo = (rightLogoFile not in ['off', '', 'inherit'] and imageSrc(rightLogoFile)) %} + {# Legacy guard: a DB row from BEFORE Prompt M (theme files updated WITHOUT a + theme reset) still carries the old on/off keys. If such a row has e.g. + centerlogo="off" while its old centerlogofile still holds a path, the logo + must stay hidden. After a theme reset the old keys are gone from the row + and |default('on') lets the logo show again. #} + {% set showBrandLogo = (brandLogoFile not in ['off', '', 'inherit'] and aSurveyInfo.options.brandlogo|default('on') != 'off' and imageSrc(brandLogoFile)) %} + {% set showCenterLogo = (centerLogoFile not in ['off', '', 'inherit'] and aSurveyInfo.options.centerlogo|default('on') != 'off' and imageSrc(centerLogoFile)) %} + {% set showRightLogo = (rightLogoFile not in ['off', '', 'inherit'] and aSurveyInfo.options.rightlogo|default('on') != 'off' and imageSrc(rightLogoFile)) %} {# THEME ADDITION: font for the header / top menu (config.xml option "headerfont", type fontselect). "base" = same as the base font: no extra class, the navbar inherits the body font (body gets font-). Applied on #survey-nav,