|
|
Hello,
this is the full debug output. I attached this output as a pdf also.
Error
Call to a member function delete() on array
/var/www/survey/application/helpers/expressions/em_manager_helper.php(5534)
5522 $cSave->set_answer_time();
5523 }
5524
5525 if ($finished) {
5526 // Delete the save control record if successfully finalize the submission
5527 $criteria = new CDbCriteria;
5528 $criteria->addCondition('srid=:srid');
5529 $criteria->addCondition('sid=:sid');
5530 $criteria->params = [':srid'=>$_SESSION[$this->sessid]['srid'],':sid'=>$this->sid];
5531 $savedControl = SavedControl::model()->findAll($criteria);
5532
5533 if($savedControl){
5534 $savedControl->delete();
5535 }
5536
5537 if (($this->debugLevel & LEM_DEBUG_VALIDATION_SUMMARY) == LEM_DEBUG_VALIDATION_SUMMARY) {
5538 $message .= '; '.$query;
5539 }
5540
5541 }
5542 else if ($this->surveyOptions['allowsave'] && isset($_SESSION[$this->sessid]['scid']))
5543 {
5544 SavedControl::model()->updateByPk($_SESSION[$this->sessid]['scid'], array('saved_thisstep'=>$thisstep));
5545 }
5546 // Check Quotas
Stack Trace
#0
– /var/www/survey/application/helpers/expressions/em_manager_helper.php(5287): LimeExpressionManager->_UpdateValuesInDatabase(true)
5282 while (true)
5283 {
5284 $LEM->currentQset = array(); // reset active list of questions
5285 if (++$LEM->currentQuestionSeq >= $LEM->numQuestions) // Move next with finished, but without submit.
5286 {
5287 $message .= $LEM->_UpdateValuesInDatabase(true);
5288 $LEM->runtimeTimings[] = array(METHOD,(microtime(true) - $now));
5289 $LEM->lastMoveResult = array(
5290 'finished'=>true,
5291 'message'=>$message,
5292 'qseq'=>$LEM->currentQuestionSeq,
#1
– /var/www/survey/application/helpers/SurveyRuntimeHelper.php(843): LimeExpressionManager::NavigateForwards()
838 $this->aMoveResult = false; // so display welcome page again
839 }
840 }
841
842 if ($this->sMove == "movenext") {
843 $this->aMoveResult = LimeExpressionManager::NavigateForwards();
844 }
845
846 if (($this->sMove == 'movesubmit')) {
847 if ($this->sSurveyMode == 'survey') {
848 $this->aMoveResult = LimeExpressionManager::NavigateForwards();
#2
– /var/www/survey/application/helpers/SurveyRuntimeHelper.php(540): SurveyRuntimeHelper->setMoveResult()
535 $this->initTotalAndMaxSteps();
536 $this->checkIfUseBrowserNav(); // Check if user used browser navigation, or relaoded page
537
538 if ($this->sMove != 'clearcancel' && $this->sMove != 'confirmquota') {
539 $this->checkPrevStep(); // Check if prev step is set, else set it
540 $this->setMoveResult();
541 $this->checkClearCancel();
542 $this->setPrevStep();
543 $this->checkIfFinished();
544 $this->setStep();
545
#3
– /var/www/survey/application/helpers/SurveyRuntimeHelper.php(106): SurveyRuntimeHelper->initMove()
101 if (!isset($_SESSION[$this->LEMsessid]['step'])) {
102 $this->showTokenOrCaptchaFormsIfNeeded();
103 }
104
105 if (!$this->previewgrp && !$this->previewquestion) {
106 $this->initMove(); // main methods to init session, LEM, moves, errors, etc
107 $this->checkQuotas(); // check quotas (then the process will stop here)
108 $this->displayFirstPageIfNeeded();
109 $this->saveAllIfNeeded();
110 $this->saveSubmitIfNeeded();
111
#4
– /var/www/survey/application/controllers/survey/index.php(598): SurveyRuntimeHelper->run("516657", array("surveyid" => "516657", "thissurvey" => array("htmlemail" => "Y", "format" => "S", "template" => "fruity", "language" => "de", ...), "thisstep" => "64", "clienttoken" => "yP3azMcPHCXG2Io", ...))
593 unset($redata);
594 $redata = compact(array_keys(get_defined_vars()));
595 Yii::import('application.helpers.SurveyRuntimeHelper');
596 $tmp = new SurveyRuntimeHelper();
597 try {
598 $tmp->run($surveyid, $redata);
599 } catch (WrongTemplateVersionException $ex) {
600 echo $ex->getMessage();
601 }
602
603 if (App()->request->getPost('saveall')) {
#5
– /var/www/survey/application/controllers/survey/index.php(24): index->action()
19 public $oTemplate;
20
21 public function run()
22 {
23 useFirebug();
24 $this->action();
25 }
26
27 public function action()
28 {
29 global $surveyid;
#6
– /var/www/survey/framework/web/actions/CAction.php(76): index->run()
71 {
72 $method=new ReflectionMethod($this, 'run');
73 if($method->getNumberOfParameters()>0)
74 return $this->runWithParamsInternal($this, $method, $params);
75
76 $this->run();
77 return true;
78 }
79
80 /*
81 Executes a method of an object with the supplied named parameters.
#7
– /var/www/survey/framework/web/CController.php(308): CAction->runWithParams(array("sid" => "516657"))
303 {
304 $priorAction=$this->_action;
305 $this->_action=$action;
306 if($this->beforeAction($action))
307 {
308 if($action->runWithParams($this->getActionParams())===false)
309 $this->invalidActionParams($action);
310 else
311 $this->afterAction($action);
312 }
313 $this->_action=$priorAction;
#8
– /var/www/survey/framework/web/CController.php(286): CController->runAction(index)
281 @see runAction
282 /
283 public function runActionWithFilters($action,$filters)
284 {
285 if(empty($filters))
286 $this->runAction($action);
287 else
288 {
289 $priorAction=$this->_action;
290 $this->_action=$action;
291 CFilterChain::create($this,$action,$filters)->run();
#9
– /var/www/survey/framework/web/CController.php(265): CController->runActionWithFilters(index, array())
260 {
261 if(($parent=$this->getModule())===null)
262 $parent=Yii::app();
263 if($parent->beforeControllerAction($this,$action))
264 {
265 $this->runActionWithFilters($action,$this->filters());
266 $parent->afterControllerAction($this,$action);
267 }
268 }
269 else
270 $this->missingAction($actionID);
#10
– /var/www/survey/framework/web/CWebApplication.php(282): CController->run("index")
277 {
278 list($controller,$actionID)=$ca;
279 $oldController=$this->_controller;
280 $this->_controller=$controller;
281 $controller->init();
282 $controller->run($actionID);
283 $this->_controller=$oldController;
284 }
285 else
286 throw new CHttpException(404,Yii::t('yii','Unable to resolve the request "{route}".',
287 array('{route}'=>$route===''?$this->defaultController:$route)));
#11
– /var/www/survey/framework/web/CWebApplication.php(141): CWebApplication->runController("survey/index/sid/516657")
136 foreach(array_splice($this->catchAllRequest,1) as $name=>$value)
137 $_GET[$name]=$value;
138 }
139 else
140 $route=$this->getUrlManager()->parseUrl($this->getRequest());
141 $this->runController($route);
142 }
143
144 /
145 Registers the core application components.
146 This method overrides the parent implementation by registering additional core components.
#12
– /var/www/survey/framework/base/CApplication.php(185): CWebApplication->processRequest()
180 public function run()
181 {
182 if($this->hasEventHandler('onBeginRequest'))
183 $this->onBeginRequest(new CEvent($this));
184 register_shutdown_function(array($this,'end'),0,false);
185 $this->processRequest();
186 if($this->hasEventHandler('onEndRequest'))
187 $this->onEndRequest(new CEvent($this));
188 }
189
190 /
#13
– /var/www/survey/index.php(195): CApplication->run()
190 require_once APPPATH . 'core/LSYii_Application' . EXT;
191
192 $config = require_once(APPPATH . 'config/internal' . EXT);
193
194 Yii::$enableIncludePath = false;
195 Yii::createApplication('LSYii_Application', $config)->run();
196
197 / End of file index.php /
198 / Location: ./index.php /
2018-01-20 12:22:12 Apache Yii Framework/1.1.18 |
|
|
Hi All,
I managed to get this working in the end by commenting out some of the code in one of the helpers. The side effect is that after submission someone will be able to go back in and amend their answer because it doesn't remove the saved answer however if they do this it overwrites the submission they originally made so for us it actually works better. Either way, the important thing for me is that it allows someone to submit a saved form.
The file i had to edit was em_manager_helper.php which is stored in the application\helpers\extension folder.
The lines i commented out were 5533 to 5535.
if($savedControl) {
$savedControl->delete();
}
We could still do with a proper fix but until then I hope this helps you all.
Ed |