View Issue Details

This bug affects 1 person(s).
 2
IDProjectCategoryView StatusLast Update
07942Bug reportsOtherpublic2013-09-23 13:27
ReporterGambito Assigned Toc_schmitz  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.00+ 
Fixed in Version2.00+ 
Summary07942: Error when copying questions with subquestions
Description

When we try to copy a question with subquestions an error ocurrs when saving the copy.

Steps To Reproduce
  1. Select a survey.
  2. Select a group of questions.
  3. Select a question with subquestions.
  4. Copy the question.
  5. Save.
Additional Information

PHP notice
Undefined offset: 1

D:\Web\limesurvey\application\controllers\admin\database.php(320)

308
309 //$insertqids=array(); //?
310 $insertqid =array();
311 for ($scale_id=0;$scale_id<$scalecount;$scale_id++)
312 {
313 foreach ($anslangs as $language)
314 {
315 $position=0;
316 foreach ($rows[$scale_id][$language] as $subquestionkey=>$subquestionvalue)
317 {
318 if (substr($subquestionkey,0,3)!='new')
319 {
320 Questions::model()->updateByPk(array('qid'=>$subquestionkey, 'language'=>$language), array('question_order'=>$position+1, 'title'=>$codes[$scale_id][$position], 'question'=>$subquestionvalue, 'scale_id'=>$scale_id));
321
322 if(isset($oldcodes[$scale_id][$position]) && $codes[$scale_id][$position] !== $oldcodes[$scale_id][$position])
323 {
324 Conditions::model()->updateAll(array('cfieldname'=>'+'.$surveyid.'X'.$gid.'X'.$qid.$codes[$scale_id][$position], 'value'=>$codes[$scale_id][$position]), 'cqid=:cqid AND cfieldname=:cfieldname AND value=:value', array(':cqid'=>$qid, ':cfieldname'=>$surveyid.'X'.$gid.'X'.$qid, ':value'=>$oldcodes[$scale_id][$position]));
325
326 }
327
328 }
329 else
330 {
331 if (!isset($insertqid[$scale_id][$position]))
332 {
Stack Trace
#0 unknown(0): database->index(null)
#1 +– D:\Web\limesurvey\framework\web\actions\CAction.php(107): ReflectionMethod->invokeArgs(database, array(null))
102 else if($param->isDefaultValueAvailable())
103 $ps[]=$param->getDefaultValue();
104 else
105 return false;
106 }
107 $method->invokeArgs($object,$ps);
108 return true;
109 }
110 }

#2 +– D:\Web\limesurvey\application\core\Survey_Common_Action.php(100): CAction->runWithParamsInternal(database, ReflectionMethod, array("r" => "admin/database"))
095 $oMethod = new ReflectionMethod($this, $sDefault);
096 }
097
098 // We're all good to go, let's execute it
099 // runWithParamsInternal would automatically get the parameters of the method and populate them as required with the params
100 return parent::runWithParamsInternal($this, $oMethod, $params);
101 }
102
103 /*
104
Some functions have different parameters, which are just an alias of the
105 * usual parameters we're getting in the url. This function just populates

#3 +– D:\Web\limesurvey\framework\web\CController.php(309): Survey_Common_Action->runWithParams(array("r" => "admin/database"))
304 {
305 $priorAction=$this->_action;
306 $this->_action=$action;
307 if($this->beforeAction($action))
308 {
309 if($action->runWithParams($this->getActionParams())===false)
310 $this->invalidActionParams($action);
311 else
312 $this->afterAction($action);
313 }
314 $this->_action=$priorAction;

#4 +– D:\Web\limesurvey\framework\web\CController.php(287): CController->runAction(database)
282 @see runAction
283
/
284 public function runActionWithFilters($action,$filters)
285 {
286 if(empty($filters))
287 $this->runAction($action);
288 else
289 {
290 $priorAction=$this->_action;
291 $this->_action=$action;
292 CFilterChain::create($this,$action,$filters)->run();

#5 +– D:\Web\limesurvey\framework\web\CController.php(266): CController->runActionWithFilters(database, array())
261 {
262 if(($parent=$this->getModule())===null)
263 $parent=Yii::app();
264 if($parent->beforeControllerAction($this,$action))
265 {
266 $this->runActionWithFilters($action,$this->filters());
267 $parent->afterControllerAction($this,$action);
268 }
269 }
270 else
271 $this->missingAction($actionID);

#6 +– D:\Web\limesurvey\application\controllers\AdminController.php(169): CController->run("database")
164 $this->redirect($this->createUrl('/admin/authentication/sa/login'));
165 }
166
167 }
168
169 return parent::run($action);
170 }
171
172 /*
173
Routes all the actions to their respective places
174 *

#7 +– D:\Web\limesurvey\framework\web\CWebApplication.php(276): AdminController->run("database")
271 {
272 list($controller,$actionID)=$ca;
273 $oldController=$this->_controller;
274 $this->_controller=$controller;
275 $controller->init();
276 $controller->run($actionID);
277 $this->_controller=$oldController;
278 }
279 else
280 throw new CHttpException(404,Yii::t('yii','Unable to resolve the request "{route}".',
281 array('{route}'=>$route===''?$this->defaultController:$route)));

#8 +– D:\Web\limesurvey\framework\web\CWebApplication.php(135): CWebApplication->runController("admin/database")
130 foreach(array_splice($this->catchAllRequest,1) as $name=>$value)
131 $_GET[$name]=$value;
132 }
133 else
134 $route=$this->getUrlManager()->parseUrl($this->getRequest());
135 $this->runController($route);
136 }
137
138 /*
139
Registers the core application components.
140 * This method overrides the parent implementation by registering additional core components.

#9 +– D:\Web\limesurvey\framework\base\CApplication.php(162): CWebApplication->processRequest()
157 */
158 public function run()
159 {
160 if($this->hasEventHandler('onBeginRequest'))
161 $this->onBeginRequest(new CEvent($this));
162 $this->processRequest();
163 if($this->hasEventHandler('onEndRequest'))
164 $this->onEndRequest(new CEvent($this));
165 }
166
167 /**

#10 +– D:\Web\limesurvey\index.php(178): CApplication->run()
173
174
/
175 require_once BASEPATH . 'yii' . EXT;
176 require_once APPPATH . 'core/LSYii_Application' . EXT;
177
178 Yii::createApplication('LSYii_Application', APPPATH . 'config/config' . EXT)->run();
179
180 / End of file index.php /
181 / Location: ./index.php /

2013-06-20 17:00:29 Microsoft-IIS/7.5 Yii Framework/1.1.10

TagsNo tags attached.
Attached Files
Bug heat2
Complete LimeSurvey version number (& build)130513
I will donate to the project if issue is resolvedNo
BrowserInternet Explorer
Database type & versionMicrosoft SQL Server 2008
Server OS (if known)Windows Server 2008 R2 Enterprise
Webserver software & version (if known)Internet Information Services (Version 7.5.7600.16385)
PHP VersionPHP 5.3.23

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2013-09-19 14:16

administrator   ~26295

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

c_schmitz

c_schmitz

2013-09-23 13:27

administrator   ~26318

Version 2.00+ Build 130923 released

Related Changesets

LimeSurvey: master 767b495c

2013-09-19 12:14:11

c_schmitz

Details Diff
Fixed issue 07942: Error when copying questions with subquestions and using MSSQL Affected Issues
07942
mod - application/controllers/admin/database.php Diff File

Issue History

Date Modified Username Field Change
2013-06-20 17:19 Gambito New Issue
2013-06-20 17:19 Gambito File Added: limesurvey_survey_625455.lss
2013-09-19 13:47 c_schmitz Assigned To => c_schmitz
2013-09-19 13:47 c_schmitz Status new => assigned
2013-09-19 14:16 c_schmitz Changeset attached => LimeSurvey master 767b495c
2013-09-19 14:16 c_schmitz Note Added: 26295
2013-09-19 14:16 c_schmitz Resolution open => fixed
2013-09-19 14:16 c_schmitz Status assigned => resolved
2013-09-19 14:16 c_schmitz Fixed in Version => 2.00+
2013-09-23 13:27 c_schmitz Note Added: 26318
2013-09-23 13:27 c_schmitz Status resolved => closed