View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
05121 | Bug reports | Survey editing | public | 2011-04-20 01:14 | 2011-08-30 17:44 |
Reporter | Mazi | Assigned To | dionet | ||
Priority | high | Severity | partial_block | ||
Status | closed | Resolution | fixed | ||
Product Version | 1.91RC6 | ||||
Target Version | 1.91 | Fixed in Version | 1.91+ | ||
Summary | 05121: Can't set default answers / answer set not saved? | ||||
Description | When trying to set a default answer for a list radio (flexible labels) I can select a value and click save but when returning to the same screen there is still the "no default" choice shown. | ||||
Steps To Reproduce |
| ||||
Tags | No tags attached. | ||||
Attached Files | database.diff (737 bytes)
Index: database.php =================================================================== --- database.php (revision 10017) +++ database.php (working copy) @@ -1509,7 +1509,7 @@ else { $exists=$connect->GetOne("SELECT qid FROM ".db_table_name('defaultvalues')." WHERE sqid=$sqid AND qid=$qid AND specialtype=$specialtype'' AND scale_id={$scale_id} AND language='{$language}'"); - if ($exists===false) + if ($exists===false || $exists===null) { $connect->execute('INSERT INTO '.db_table_name('defaultvalues')." (defaultvalue,qid,scale_id,language,specialtype,sqid) VALUES (".db_quoteall($defaultvalue,$ispost).",{$qid},{$scale_id},'{$language}','{$specialtype}',{$sqid})"); } | ||||
Bug heat | 4 | ||||
Complete LimeSurvey version number (& build) | 9999 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | Firefox 3.6 | ||||
Database type & version | MySQL 5 | ||||
Server OS (if known) | Win 7 | ||||
Webserver software & version (if known) | Apache 2.2 | ||||
PHP Version | 5.3.1 | ||||
This was happening because the condition that tested if a default value was set didn't work for null, so it was trying to update a value that didn't exist. Please check the patch. Thank you, |
|
Looks great, please commit to /limesurvey |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2011-04-20 01:14 | Mazi | New Issue | |
2011-04-20 01:14 | Mazi | Status | new => assigned |
2011-04-20 01:14 | Mazi | Assigned To | => c_schmitz |
2011-04-20 01:23 | dionet | Assigned To | c_schmitz => dionet |
2011-04-21 23:46 | dionet | File Added: database.diff | |
2011-04-21 23:56 | dionet | Note Added: 14852 | |
2011-04-21 23:56 | dionet | Assigned To | dionet => c_schmitz |
2011-05-03 19:58 | c_schmitz | Assigned To | c_schmitz => dionet |
2011-05-03 19:58 | c_schmitz | Note Added: 14911 | |
2011-05-05 22:16 | dionet | Status | assigned => resolved |
2011-05-05 22:16 | dionet | Fixed in Version | => 1.91+ |
2011-05-05 22:16 | dionet | Resolution | open => fixed |
2011-05-15 12:27 | c_schmitz | Status | resolved => closed |
2011-08-30 17:43 | Chiefer | Issue Monitored: Chiefer | |
2011-08-30 17:44 | Chiefer | Issue End Monitor: Chiefer | |
2019-11-01 17:25 | c_schmitz | Category | Survey design => Survey editing |