View Issue Details

This bug affects 1 person(s).
 2
IDProjectCategoryView StatusLast Update
10246Bug reportsSurvey editingpublic2016-02-01 09:05
Reporterphi1010 Assigned ToLouisGac 
PrioritynormalSeveritycrash 
Status closedResolutionfixed 
Product Version2.50.x 
Summary10246: [2.5RC7] Can't save changes to checkbox subquestions created after update.
Description

Newly created subquestions behave differently from updated ones, editing them shows a blank page.

lime_questions.type appears to set as "T" instead of "M" on subquestions created in 2.5RC7; changing this to "M" by hand does not appear to fix this problem.

The html code has differing code_ and oldcode_labels; 15 is the qid in the database; the quesion 8 does not exist. The old subquestions have the ids 5, 6 and 7. (html attached)

Steps To Reproduce

Update Limesurvey 2.06+ Build 151215 to Limesurvey 2.5RC7
Open existing survey (2 Languages)
Select existing checkbox question
Edit Subquestions
Add Subquestion by clicking (+) on the last existing subquestion
(Default subquestion id is strange, changed from "shift1/2/3" on old subquestions to "hift4")
Enter some text in the default language
Click Save
Edit the text of the newly created subquestion
Click Save
White Page appears; only changes to old subquestions were saved. (Debug mode error page attached.)

                                                                                                        <input class="oldcode" id="oldcode_15_0" name="oldcode_8_0" value="shift4" type="hidden">
                                                    <input class="code form-control input-lg" id="code_8_0" name="code_8_0" value="shift4" maxlength="20" size="20" pattern="^([a-zA-Z0-9]*|shift4)$" required="required" type="text">
Additional Information

PHP warning

Creating default object from empty value

.../limesurvey/application/controllers/admin/database.php(281)

269 for ($iScaleID=0;$iScaleID<$iScaleCount;$iScaleID++)
270 {
271 foreach ($aSurveyLanguages as $sLanguage)
272 {
273 $iPosition=0;
274 foreach ($aRows[$iScaleID][$sLanguage] as $subquestionkey=>$subquestionvalue)
275 {
276
277 if (substr($subquestionkey,0,3)!='new') //update record
278 {
279
280 $oSubQuestion=Question::model()->find("qid=:qid AND language=:language",array(":qid"=>$subquestionkey,':language'=>$sLanguage));
281 $oSubQuestion->question_order=$iPosition+1;
282 $oSubQuestion->title=$aCodes[$iScaleID][$iPosition];
283 $oSubQuestion->question=$subquestionvalue;
284 $oSubQuestion->scale_id=$iScaleID;
285 $oSubQuestion->relevance=$aRelevance[0][$iPosition];
286 }
287 else // new record
288 {
289 if (!isset($aInsertQID[$iScaleID][$iPosition])) //new record: first (default) language
290 {
291 $oSubQuestion=new Question;
292 $oSubQuestion->sid=$iSurveyID;
293 $oSubQuestion->gid=$iQuestionGroupID;

Stack Trace
#0
unknown(0): database->index(null)
#1
+
.../limesurvey/framework/web/actions/CAction.php(109): ReflectionMethod->invokeArgs(database, array(null))
#2

.../limesurvey/application/core/Survey_Common_Action.php(101): CAction->runWithParamsInternal(database, ReflectionMethod, array())

096 $oMethod = new ReflectionMethod($this, $sDefault);
097 }
098
099 // We're all good to go, let's execute it
100 // runWithParamsInternal would automatically get the parameters of the method and populate them as required with the params
101 return parent::runWithParamsInternal($this, $oMethod, $params);
102 }
103
104 /*
105
Some functions have different parameters, which are just an alias of the
106 * usual parameters we're getting in the url. This function just populates

#3
+
.../limesurvey/framework/web/CController.php(308): Survey_Common_Action->runWithParams(array())
#4
+
.../limesurvey/framework/web/CController.php(286): CController->runAction(database)
#5
+
.../limesurvey/framework/web/CController.php(265): CController->runActionWithFilters(database, array())
#6

.../limesurvey/application/controllers/AdminController.php(165): CController->run("database")

160 $this->redirect(array('/admin/authentication/sa/login'));
161 }
162
163 }
164
165 return parent::run($action);
166 }
167
168 /*
169
Routes all the actions to their respective places
170 *

#7
+
.../limesurvey/framework/web/CWebApplication.php(282): AdminController->run("database")
#8
+
.../limesurvey/framework/web/CWebApplication.php(141): CWebApplication->runController("admin/database")
#9
+
.../limesurvey/framework/base/CApplication.php(184): CWebApplication->processRequest()
#10

.../limesurvey/index.php(211): CApplication->run()

206 die (sprintf('%s should be writable by the webserver (766 or 776).', $runtimePath));
207 }
208 }
209
210 Yii::$enableIncludePath = false;
211 Yii::createApplication('LSYii_Application', $config)->run();
212
213 / End of file index.php /
214 / Location: ./index.php /

2016-01-23 23:58:10 Apache Yii Framework/1.1.16

TagsNo tags attached.
Bug heat2
Complete LimeSurvey version number (& build)160122
I will donate to the project if issue is resolvedNo
BrowserFirefox Developer 45.0a2 (2016-01-17) on Windows 10 x64
Database type & versionMySQL 5.5.46-0+deb8u1 - (Debian)
Server OS (if known)Debian
Webserver software & version (if known)Apache?
PHP Versionunknown

Users monitoring this issue

There are no users monitoring this issue.

Activities

LouisGac

LouisGac

2016-01-29 13:08

developer   ~34417

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

Related Changesets

LimeSurvey: 2.5 b3d53f6f

2016-01-29 12:08:11

LouisGac

Details Diff
Fixed issue 10246: updatequestion function only for new items Affected Issues
10246
mod - application/controllers/admin/database.php Diff File
mod - scripts/admin/subquestions.js Diff File
mod - templates/default/css/template.css Diff File
mod - templates/default/scripts/template.js Diff File

Issue History

Date Modified Username Field Change
2016-01-24 00:28 phi1010 New Issue
2016-01-25 11:27 c_schmitz Product Version => 2.5
2016-01-25 11:27 c_schmitz Additional Information Updated
2016-01-25 11:27 c_schmitz Assigned To => LouisGac
2016-01-25 11:27 c_schmitz Status new => assigned
2016-01-29 10:40 LouisGac Severity partial_block => crash
2016-01-29 13:08 LouisGac Changeset attached => LimeSurvey 2.5 b3d53f6f
2016-01-29 13:08 LouisGac Note Added: 34417
2016-01-29 13:08 LouisGac Resolution open => fixed
2016-01-29 13:09 LouisGac Status assigned => resolved
2016-02-01 09:05 c_schmitz Status resolved => closed
2019-11-01 17:25 c_schmitz Category Survey design => Survey editing