View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
16895Bug reportsOtherpublic2020-12-28 10:42
Reportergabrieljenik Assigned Togabrieljenik  
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version4.3.30 
Summary16895: Question radio button with Question Theme "Bootstrap Buttons" does not keep value in "Other" field
Description

Question radio button with Question Theme "Bootstrap Buttons" does not keep value in "Other" field and does not show "Other field" going to the previous page of the survey

This is for v4.
Original was for V3

Steps To Reproduce
  • Create 2 question groups
  • In the first group create a Radio Button question with theme "Bootstrap Button" allowing the button other and setting it to mandatory
  • In the second group a random question
  • start survey
  • select the button "Other" and complete the Other field with random text.
  • click next (in the DB the text has been saved) -> click back
  • the field in which you should insert the text for "other" is not visible, and when visible, it is empty

See attached survey.

Additional Information

That doesn't happen without the theme "Bootstrap Button"

TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)4.3.30
I will donate to the project if issue is resolvedNo
BrowserAny
Database type & versionMySQL
Server OS (if known)
Webserver software & version (if known)
PHP Version7.2.33

Relationships

related to 16849 closedgabrieljenik Question radio button with Question Theme "Bootstrap Buttons" does not keep value in "Other" field 

Users monitoring this issue

There are no users monitoring this issue.

Activities

gabrieljenik

gabrieljenik

2020-12-10 15:35

manager   ~60914

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

gabrieljenik

gabrieljenik

2020-12-15 23:08

manager   ~60972

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

lime_release_bot

lime_release_bot

2020-12-28 10:42

administrator   ~61175

Fixed in Release 4.3.32+201221

Related Changesets

LimeSurvey: master 1d43694f

2020-12-15 23:08:03

gabrieljenik


Committer: GitHub Details Diff
Fixed issue 16895: Question radio button with Question Theme "Bootstrap Buttons" does not keep value in "Other" field (#1683)

There were two problems:
1) The 'other' answer value from the DB was never used by the theme to feed it into the screen ($answer_other was not used in answer_row_other.twig).
2) The show/hide code is part of the radio's 'change' event, which was only trigger on an actual change, not initially to setup the screen

An additional problem is that, in this theme, the 'other' input control is outside the scope of answer_row_other.twig, so the value cannot be directly assigned when rendering. Instead, a hidden input had to be added to hold the value until it can be transfered by javascript to the actual control.

At last, as the doBootstrapRadio is called multiple times (once per question in the screen), the event assignment happens multiple times as well.
Affected Issues
16895
mod - themes/question/bootstrap_buttons/survey/questions/answer/listradio/assets/scripts/bootstrapbuttons.js Diff File
mod - themes/question/bootstrap_buttons/survey/questions/answer/listradio/rows/answer_row_other.twig Diff File

Issue History

Date Modified Username Field Change
2020-12-10 15:25 gabrieljenik New Issue
2020-12-10 15:25 gabrieljenik Issue generated from: 16849
2020-12-10 15:25 gabrieljenik Relationship added related to 16849
2020-12-10 15:35 gabrieljenik Note Added: 60914
2020-12-15 23:08 gabrieljenik Changeset attached => LimeSurvey master 1d43694f
2020-12-15 23:08 gabrieljenik Note Added: 60972
2020-12-15 23:08 gabrieljenik Assigned To => gabrieljenik
2020-12-15 23:08 gabrieljenik Resolution open => fixed
2020-12-28 10:42 lime_release_bot Note Added: 61175
2020-12-28 10:42 lime_release_bot Status new => closed