View Issue Details

IDProjectCategoryView StatusLast Update
15932Development Survey editingpublic2020-02-28 23:21
ReporterMindflow Assigned To 
PrioritynoneSeveritypartial_block 
Status newResolutionopen 
Summary15932: Question Editor does not load data for custom attributes of a question theme
Description

I wrote an own question theme https://github.com/florianheller/LimeSurvey_SVG_Selection that adds an additional attribute and a custom view to the multiplechoice question type.

In the question editor, the custom attribute field is correctly loaded in the advanced settings. Once I enter something in that field and click save, the value is correctly stored in the database, but on while reloading the data, the field is set back to the default value/emptied. At the same time, the custom view is also not loaded.

As discussed in https://www.limesurvey.org/forum/development/120359-developing-a-question-theme-issues-with-saving-and-rendering, this only affects part of the LS installations as some don't have that problem.

Steps To Reproduce

The value is gone and the question preview does not use the correct rendering template (it uses the multiplechoice one, not the one from the theme's answer.twig) .

Additional Information

Version 4.1.7+200224
PHP
Tested both on shared hosting (IONOS) and in a virtual machine (bitnami LAMP)
See discussion at https://www.limesurvey.org/forum/development/120359-developing-a-question-theme-issues-with-saving-and-rendering for screencasts.

TagsNo tags attached.

Activities

Mindflow

Mindflow

2020-02-28 13:22

reporter  

svgSelection.zip (316,121 bytes)
DenisChenu

DenisChenu

2020-02-28 15:04

developer   ~56257

For my screencast

$ git reset --hard origin/master
HEAD est maintenant à 10454b9ffd Fixed issue 15920

7.3.14-1~deb10u1
Apache/2.4.38 (Debian)
mysqlnd 5.0.12-dev - 20150407
5.5.5-10.3.22-MariaDB-0+deb10u1

Mindflow

Mindflow

2020-02-28 23:21

reporter   ~56262

Hi,
I just came across something that might be relevant: if I take a look at the local storage in the Storage-tab in the Firefox developer tools i see the following: in the lstquestion_ entries I have for the svg_image_url entry
"svg_image_url":{"name":"svg_image_url","title":"Image path","inputtype":"text","formElementId":"svg_image_url","formElementName":false,"formElementHelp":"An absolute path to the image","formElementValue":"","aFormElementOptions":{"name":"svg_image_url","options":null,"category":"Display","default":"http://...","value":"","sortorder":"80","i18n":"en","readonly":false,"readonly_when_active":false,"expression":"1","classes":["form-control"]}}

whereas for
"cssclass":{"name":"cssclass","title":"CSS class(es)","inputtype":"text","formElementId":"cssclass","formElementName":false,"formElementHelp":"Add additional CSS class(es) for this question. Use a space between multiple CSS class names. You\n may use expressions - remember this part is static.\n ","formElementValue":"","aFormElementOptions":{"name":"cssclass","category":"Display","sortorder":"102","expression":"1","i18n":[],"readonly":[],"readonly_when_active":[],"classes":["form-control"]}}

So the aFormElementOptions differ (some options are (not) arrays). Maybe this helps to track down the issue.

Issue History

Date Modified Username Field Change
2020-02-28 13:22 Mindflow New Issue
2020-02-28 13:22 Mindflow File Added: svgSelection.zip
2020-02-28 13:22 Mindflow File Added: limesurvey_survey_426395.lss
2020-02-28 15:04 DenisChenu Note Added: 56257
2020-02-28 23:21 Mindflow Note Added: 56262