View Issue Details

This bug affects 3 person(s).
 50
IDProjectCategoryView StatusLast Update
17811Bug reportsTheme editorpublic2022-05-02 10:33
Reporterbaltzis Assigned Togabrieljenik  
PriorityhighSeveritypartial_block 
Status closedResolutionfixed 
Product Version5.2.x 
Summary17811: Theme options for logo and background images are not saved
Description

On the global, as well as on the survey Settings/Theme Options tab, the options for images (for both logo and background), are not saved correctly. When saving, in the template_configuration table, in the database, appears the following (notice the "invalid"):
\"brandlogofile\":\"invalid:image::generalfiles::logo_auth.png\"

On the images tab (survey theme options), in the logo field appears the following (see screenshot1):
Inherit [inherited value: invalid:image:theme::files\logo.png]

As a result, no logo or background images appear, although defined, and in the nav_bar.twig, the "aSurveyInfo.options.brandlogofile" specification does work, unless the image file is explicitly specified as follows:
{{ image('./files/logo.png', aSurveyInfo.name, {"class": "logo img-responsive"}) }}

Besides, when extending a theme, while trying to define the survey theme options for the first time, the following error message appears (see screenshot2):
Error: Malformed JSON - field files_js must be either a JSON array or the string "inherit". Found "null".

Steps To Reproduce

Steps to reproduce

  1. Delete all the extended themes and make sure they are gone from the template_configuration table.
  2. Extend a single theme.
  3. Query the template_configuration table to find the new template config row.
  4. Look in the options field. The default logo is displayed as \"brandlogofile\":\"invalid:image::generalfiles::logo_auth.png\"
    ---Optional steps
  5. Upload a new image.
  6. Select the uploaded image in the Theme Options tab (either global or in a survey), using the drop-down menu, and click Save.
  7. In the options field, the new value for "brandlogofile" will also include "invalid".

Expected result

To display the selected logo and/or background image.

Actual result

No logo and/or no background image displayed. No values are saved in the Theme Options tab (on both global and survey levels).

TagsNo tags attached.
Attached Files
Screenshot1.png (29,504 bytes)   
Screenshot1.png (29,504 bytes)   
Screenshot2.png (125,403 bytes)
Bug heat50
Complete LimeSurvey version number (& build)5.2.6+211213
I will donate to the project if issue is resolvedNo
BrowserChrome
Database type & versionmysql, driver version mysqlnd 5.0.12-dev - 20150407 - Id: 38fea24f2847fa7519001be390c98ae0acafe387
Server OS (if known)Windows NT WIN-A34LDHDT6H4 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
Webserver software & version (if known)Microsoft-IIS/8.5
PHP Version7.2.7

Relationships

related to 17704 closedgalads Upload of resources (images) does not work 
has duplicate 17810 closedgalads Theme options for logo and background images are not saved 
has duplicate 17809 closedgalads Theme options for logo and background images are not saved 
has duplicate 17808 closedgalads Theme options for images are not saved 

Users monitoring this issue

baltzis, DenisChenu, tammo

Activities

galads

galads

2021-12-16 12:44

reporter   ~67797

Hello, thank you for reporting this issue. Which specific theme does this bug affect?

Or does it happen for all themes?

baltzis

baltzis

2021-12-16 13:27

reporter   ~67804

It happens for all themes (this is why I am not referring to any specific). However, in another installation under Linux (on another machine), this issue does not appear.

galads

galads

2021-12-16 14:48

reporter   ~67806

Thank you for the information. It seems to be a windows issue because I could also not reproduce in Linux.

baltzis

baltzis

2021-12-17 09:57

reporter   ~67809

I confirmed that the same issue appears with "Skelvanilla" theme too. It is definitely not a theme-dependent issue. If that helps, my tests show that it concerns only images. All other options are saved correctly.

DenisChenu

DenisChenu

2021-12-17 16:46

developer   ~67811

Image or file + windows : this surely check something without DIRECTORY_SEPARATOR when save :)

tammo

tammo

2021-12-20 09:57

developer   ~67813

If Denis is right, can this be solved, please. It is hindering theme development enormously...

tammo

tammo

2021-12-20 10:05

developer   ~67814

I think it also relates to error 17704, since that also occurs on WAMP (Windows) only, it seems.

tammo

tammo

2022-01-11 14:57

developer   ~67959

Is there anyone working on this, please?

DenisChenu

DenisChenu

2022-01-11 15:42

developer   ~67963

Not me : i don't have windows on 5.X

baltzis

baltzis

2022-03-13 18:29

reporter   ~68647

Is there any progress with this bug, please? No one using LimeSurvey on Windows will be able to develop custom themes. Very inconvenient.

lamacs

lamacs

2022-03-14 11:43

reporter   ~68660

error still exists on ver. 5.2.10+220118, is anybody work on it ?

image.png (91,003 bytes)   
image.png (91,003 bytes)   
tammo

tammo

2022-04-07 09:57

developer   ~68919

Dear developer, please look into this. It is a regression from 3.x and I think it will not be very difficult to solve...

baltzis

baltzis

2022-04-07 11:42

reporter   ~68920

Would it perhaps help to offer a donation if the issue is resolved?

gabrieljenik

gabrieljenik

2022-04-07 15:28

manager   ~68926

Hi,

We are working on it.
It is not an easy fix.

Thanks

gabrieljenik

gabrieljenik

2022-04-07 17:33

manager   ~68929

PR: https://github.com/LimeSurvey/LimeSurvey/pull/2336

Two problems found.
1) Wrong directory separator being used.
2) A theme can no longer access a file from another theme. But in the config.xml of the base themes, the logo paths were relative to root, instead of being relative to the theme. So when copying, in the extended theme it had a path that was not inside its folder, but in that of another theme, and that is why it was also considered invalid. That should be happening on Linux too, because it has nothing to do with Windows.

baltzis

baltzis

2022-04-07 18:58

reporter   ~68938

@gabrieljenik: Thanks for the reply. This is very interesting and strange because the same problem does not appear in my other installation in Linux.

--> Linux elpida3.it.auth.gr 4.15.0-176-generic #185-Ubuntu SMP Tue Mar 29 17:40:04 UTC 2022 x86_64

tammo

tammo

2022-04-09 10:59

developer   ~68961

Could it be that 1 is the main problem that baltzis and I (and possibly others) encountered and that 2 was not (yet) encountered by us?

gabrieljenik

gabrieljenik

2022-04-11 16:16

manager   ~68995

@baltzis, Thanks for the reply. This is very interesting and strange because the same problem does not appear in my other installation in Linux.

Can you describe more about the theme and the logo path in the config.xml of it?

tammo, Could it be that 1 is the main problem that baltzis and I (and possibly others) encountered and that 2 was not (yet) encountered by us?

Sure. NUmber 2 should only appear on very specific situations.

baltzis

baltzis

2022-04-12 09:50

reporter   ~68997

@gabrieljenik:

Can you describe more about the theme and the logo path in the config.xml of it?

I am not sure what you are asking for. I am sending the config.xml for extends_bootswatch, as an example. Hopefully, this responds to your request. Please, let me know if you need more information.

For the custom logo to appear, I have to specify the path explicitly in the nav_bar.twig:
{{ image('./files/logo_auth.png', aSurveyInfo.name, {"class": "logo img-responsive"}) }}

If I don't make any changes, the logo does not appear, because in the config.xml the specified file is not saved at all (see the tag <brandlogofile>). In addition, the field "Brandlogo file" in the options of the theme, appears blank, even if I specify the default theme logo (see attached screenshot).

config.xml (2,248 bytes)   
<?xml version="1.0" encoding="UTF-8"?>
<!--

    (¯`·._.·(¯`·._.· Bootswatch Theme Manifest  ·._.·´¯)·._.·´¯)

    Base configuration for Vanilla Theme.
    The content of this file is imported into DB when you install the template.

-->
<config>
    <!-- Those metadata are displayed in the theme configuration page.  -->
    <metadata>
        <name>extends_bootswatch</name>
        <title>Bootswatch Theme</title>

        <creationDate/>
        <author>baltzis</author>
        <authorEmail>baltzis@jour.auth.gr</authorEmail>
        <authorUrl>http://www.limesurvey.org</authorUrl>
        <copyright>Copyright (C) 2005 - 2016 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later</license>
        <version>2.0</version>
        <apiVersion>3</apiVersion>
        <description><![CDATA[<strong>LimeSurvey Bootwatch Theme</strong><br>Based on BootsWatch Themes: <a href='https://bootswatch.com/3/'>Visit BootsWatch page</a> ]]></description>
        <last_update>2021-08-30 03:10:07</last_update>
        <extends>bootswatch</extends>
    <lastUpdate>2021-12-06 15:08:54</lastUpdate></metadata>

    <!--
        Here the list of the css/js files to add to the template package.
        About packages in Yii: http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail
    -->
    <files>
        <css>
            <add>css/ajaxify.css</add>
            <add>css/theme.css</add>
            <add>css/custom.css</add>
        </css>
        <js>
            <add>scripts/theme.js</add>
            <add>scripts/ajaxify.js</add>
            <add>scripts/custom.js</add>
        </js>
        <print_css>
            <add>css/print_theme.css</add>
        </print_css>
    </files>

    <!-- You can add here any option you want. It will be available in twig file via aSurveyInfo.options.youroptionname -->
    <!-- eg: Ajaxmode: will be available with aSurveyInfo.options.ajaxmode -->
    <options>
        <ajaxmode>on</ajaxmode>
        <brandlogo>on</brandlogo>
        <brandlogofile>./files/logo.png</brandlogofile>
        <container>on</container>
    </options>

    <!-- Here datas about how LimeSurvey should load the theme -->
    

</config>
config.xml (2,248 bytes)   
gabrieljenik

gabrieljenik

2022-04-12 21:11

manager   ~69021

Couple of questions.
1) On step#2 of your reproduction list, do you upload the logo_auth.png file? If not, when?
2) Does the situation still happens after the patch?

baltzis

baltzis

2022-04-12 21:48

reporter   ~69023

1) In step #2, I uploaded the logo_auth.png after extending the template (it appears on the right side - see screenshot).
2) What is the patch you are referring to? If you mean the change in the nav_bar.twig, the field remains blank, however, the correct logo appears when the survey is tested and activated, and in the preview on the theme editor page as well. This means - of course - that a new template needs to be created for each survey since the custom logo is not saved in "local" survey options either.

gabrieljenik

gabrieljenik

2022-04-12 22:28

manager   ~69024

1) After uploading it, do you set it as logo on the theme options?
2) I mean this patch: https://github.com/LimeSurvey/LimeSurvey/pull/2336
I understand the correct logo appears when you force it in the twig file.
I was hoping to leave the twig file as it comes from the default theme and use the theme options for setting the logo

baltzis

baltzis

2022-04-13 07:55

reporter   ~69031

As I tried to explain, the logo (ANY logo) is not displayed when set on the theme options. It appears only when forced in the twig file. I forced the logo in the twig file only after I established that LimeSurvey fails to save the path correctly in the theme options.
Concerning the "bootswatch" theme, however, no option selected from any dropdown list is saved on the theme options page whatsoever (variation or logo image). I just tried it again by creating a fresh copy. For other themes (e.g. fruity), this problem appears only for any images (logo, background).

Concerning the patch, I don't understand what you mean. I did not apply any patch, as I don't know how to do this.

gabrieljenik

gabrieljenik

2022-04-13 14:37

manager   ~69053

Hi Baltiz,

I think the conversation got a little de-railed.
Let's try to pickup.

I mentioned there was an issue that should be happening on both Win and Linux.
You said that on Linux it wasn't reproducible, the bug not appearing.
We started reviewing that.
You are saying the bug appears.
I think we got entangled.

So,my suggestion.
Let's pickup after the PR is merged and check if there are still issues then.

What do you think?

baltzis

baltzis

2022-04-13 19:57

reporter   ~69064

I am saying that the bug appears only on my Windows installation. Everything I have said concerns the Windows installation alone. The installation on Linux works just fine. I never said anything about the bug appearing in Linux and I was very specific about the bug NOT appearing in my Linux installation: see my notes #67804 and #68938 above.

gabrieljenik

gabrieljenik

2022-04-27 09:09

manager   ~69263

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&amp;id=33441

LimeBot

LimeBot

2022-05-02 10:33

administrator   ~69339

Fixed in Release 5.3.12+220502

Related Changesets

LimeSurvey: master 3713129c

2022-04-27 09:09:52

gabrieljenik


Committer: GitHub Details Diff
Fixed issue 17811: Theme options for logo and background images are not saved (#2336)

Co-authored-by: encuestabizdevgit <devgit@encuesta.biz>
Affected Issues
17811
mod - application/helpers/SurveyThemeHelper.php Diff File
mod - themes/survey/bootswatch/config.xml Diff File
mod - themes/survey/fruity/config.xml Diff File
mod - themes/survey/vanilla/config.xml Diff File

Issue History

Date Modified Username Field Change
2021-12-16 11:33 baltzis New Issue
2021-12-16 11:33 baltzis File Added: Screenshot1.png
2021-12-16 11:33 baltzis File Added: Screenshot2.png
2021-12-16 12:44 galads Note Added: 67797
2021-12-16 12:44 galads Bug heat 0 => 2
2021-12-16 12:45 galads Assigned To => galads
2021-12-16 12:45 galads Status new => feedback
2021-12-16 12:46 galads Relationship added has duplicate 17810
2021-12-16 12:46 galads Issue Monitored: baltzis
2021-12-16 12:46 galads Bug heat 2 => 10
2021-12-16 12:49 galads Relationship added has duplicate 17809
2021-12-16 12:49 galads Bug heat 10 => 16
2021-12-16 12:49 galads Relationship added has duplicate 17808
2021-12-16 12:49 galads Bug heat 16 => 22
2021-12-16 13:27 baltzis Note Added: 67804
2021-12-16 13:27 baltzis Bug heat 22 => 24
2021-12-16 13:27 baltzis Status feedback => assigned
2021-12-16 14:48 galads Note Added: 67806
2021-12-17 09:57 baltzis Note Added: 67809
2021-12-17 16:46 DenisChenu Note Added: 67811
2021-12-17 16:46 DenisChenu Bug heat 24 => 26
2021-12-20 09:56 tammo Issue Monitored: tammo
2021-12-20 09:56 tammo Bug heat 26 => 28
2021-12-20 09:57 tammo Note Added: 67813
2021-12-20 09:57 tammo Bug heat 28 => 30
2021-12-20 09:57 guest Bug heat 30 => 36
2021-12-20 10:04 tammo Relationship added related to 17704
2021-12-20 10:05 tammo Note Added: 67814
2022-01-11 14:57 tammo Note Added: 67959
2022-01-11 15:42 DenisChenu Note Added: 67963
2022-01-11 17:09 galads Description Updated
2022-01-11 17:09 galads Steps to Reproduce Updated
2022-01-11 17:09 galads Zoho Project Synchronization => |Yes|
2022-03-13 18:29 baltzis Note Added: 68647
2022-03-14 08:04 galads Zoho Project Synchronization Yes => |Yes|
2022-03-14 08:04 DenisChenu Issue Monitored: DenisChenu
2022-03-14 08:04 DenisChenu Bug heat 36 => 38
2022-03-14 08:05 galads Zoho Project Synchronization Yes =>
2022-03-14 08:06 galads Zoho Project Synchronization => |Yes|
2022-03-14 11:43 lamacs Note Added: 68660
2022-03-14 11:43 lamacs File Added: image.png
2022-03-14 11:43 lamacs Bug heat 38 => 40
2022-03-15 07:55 galads Zoho Project Synchronization Yes =>
2022-03-15 07:56 galads Assigned To galads => gabrieljenik
2022-03-15 07:56 galads Zoho Project Synchronization => |Yes|
2022-04-06 16:41 gabrieljenik Priority none => high
2022-04-06 16:41 gabrieljenik Severity minor => partial_block
2022-04-06 16:41 gabrieljenik Zoho Project Synchronization Yes => |Yes|
2022-04-07 09:57 tammo Note Added: 68919
2022-04-07 11:42 baltzis Note Added: 68920
2022-04-07 15:28 gabrieljenik Note Added: 68926
2022-04-07 15:28 gabrieljenik Bug heat 40 => 42
2022-04-07 17:33 gabrieljenik Note Added: 68929
2022-04-07 17:34 gabrieljenik Status assigned => ready for testing
2022-04-07 18:58 baltzis Note Added: 68938
2022-04-08 17:18 guest Bug heat 42 => 48
2022-04-09 10:59 tammo Note Added: 68961
2022-04-11 16:16 gabrieljenik Note Added: 68995
2022-04-12 09:50 baltzis Note Added: 68997
2022-04-12 09:50 baltzis File Added: Screenshot 2022-04-12 104548.png
2022-04-12 09:50 baltzis File Added: config.xml
2022-04-12 21:11 gabrieljenik Note Added: 69021
2022-04-12 21:48 baltzis Note Added: 69023
2022-04-12 21:48 baltzis File Added: Screenshot 2022-04-12 224629.png
2022-04-12 22:28 gabrieljenik Note Added: 69024
2022-04-13 07:55 baltzis Note Added: 69031
2022-04-13 14:37 gabrieljenik Note Added: 69053
2022-04-13 19:57 baltzis Note Added: 69064
2022-04-27 09:09 gabrieljenik Changeset attached => LimeSurvey master 3713129c
2022-04-27 09:09 gabrieljenik Note Added: 69263
2022-04-27 09:09 gabrieljenik Resolution open => fixed
2022-05-02 10:33 LimeBot Note Added: 69339
2022-05-02 10:33 LimeBot Status ready for testing => closed
2022-05-02 10:33 LimeBot Bug heat 48 => 50