View Issue Details

IDProjectCategoryView StatusLast Update
16849Bug reportsOtherpublic2020-12-28 10:42
Reportercesoielampo Assigned Togabrieljenik  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version3.23.6 
Summary16849: 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

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.
Complete LimeSurvey version number (& build)3.23.6+200929
I will donate to the project if issue is resolvedNo
Sync to Zoho ProjectYes
BrowserAny
Database & DB-VersionMySQL
Server OS (if known)
Webserver software & version (if known)
PHP Version7.2.33

Relationships

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

Activities

cesoielampo

cesoielampo

2020-11-20 13:15

reporter  

gabrieljenik

gabrieljenik

2020-12-03 20:45

developer   ~60834

https://github.com/LimeSurvey/LimeSurvey/pull/1681/files

To check if this happens on LS4 too.

gabrieljenik

gabrieljenik

2020-12-14 11:49

developer   ~60943

Fix committed to 3.x-LTS branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=30799

lime_release_bot

lime_release_bot

2020-12-28 10:42

administrator   ~61173

Fixed in Release 3.25.5+201222

Related Changesets

LimeSurvey: 3.x-LTS 665c34d5

2020-12-14 11:49:41

gabrieljenik


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

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
16849
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-11-20 13:15 cesoielampo New Issue
2020-11-20 13:15 cesoielampo File Added: limesurvey_survey_789424.lss
2020-11-20 17:00 cdorin Priority none => normal
2020-11-20 17:00 cdorin Status new => confirmed
2020-11-20 17:00 cdorin Sync to Zoho Project => Yes
2020-12-03 20:45 gabrieljenik Note Added: 60834
2020-12-10 15:25 gabrieljenik Issue cloned: 16895
2020-12-10 15:25 gabrieljenik Relationship added related to 16895
2020-12-14 11:49 gabrieljenik Changeset attached => LimeSurvey 3.x-LTS 665c34d5
2020-12-14 11:49 gabrieljenik Note Added: 60943
2020-12-14 11:49 gabrieljenik Assigned To => gabrieljenik
2020-12-14 11:49 gabrieljenik Resolution open => fixed
2020-12-28 10:42 lime_release_bot Sync to Zoho Project Yes => Yes
2020-12-28 10:42 lime_release_bot Note Added: 61173
2020-12-28 10:42 lime_release_bot Status confirmed => closed