Commit 41817eb1 authored by Denis Chenu's avatar Denis Chenu
Browse files

[fix] 500 error when checking

parent 788a8b61
......@@ -89,7 +89,7 @@ function addUpdateResponse()
if($('.menubar').eq(1).find('.menubar-main').find(".menubar-left:last").length) {
$('.menubar').eq(1).find('.menubar-main').find(".menubar-left:last").append("<a class='btn btn-small updateanswer' data-recompute='1'><i class='icon-refresh'></i>Update This Answer</a>");
} else {
$('#browsermenubarid .container-fluid .col-md-12').append("<a class='btn btn-small updateanswer' data-recompute='1'><i class='icon-refresh'></i>Update all submitted answers</a>");
$('#browsermenubarid .container-fluid .col-md-12').append("<a class='btn btn-default btn-small updateanswer' data-recompute='1'><i class='icon-refresh'></i>Update all submitted answers</a>");
}
$("[data-recompute]").click(function(){
$("#updatedsrid").remove();
......
......@@ -7,7 +7,7 @@
* @copyright 2013 Denis Chenu <http://sondages.pro>
* @copyright 2013 Practice Lab <https://www.practicelab.com/>
* @license GPL v3
* @version 2.0.1
* @version 2.0.2
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -33,6 +33,7 @@ class recomputeExpression extends PluginBase
private $aUpdatedArray=array();
private $_iSurveyId;
private $_iResponseId;
protected $settings = array(
'bAllowNonAdmin' => array(
......@@ -92,7 +93,7 @@ class recomputeExpression extends PluginBase
public function actionRecompute()
{
// Needed parameters sid: the survey id
$this->__iSurveyId = $iSurveyId=(int)Yii::app()->request->getQuery('sid', 0);
$this->_iSurveyId = $iSurveyId=(int)Yii::app()->request->getQuery('sid', 0);
// Optionnal parameters : token
$sToken=(string)Yii::app()->request->getQuery('token', "");
// Optionnal parameters : srid
......@@ -149,7 +150,7 @@ class recomputeExpression extends PluginBase
if($oResponse)
{
$iResponseId=$oResponse->id;
$this->_iResponseId = $iResponseId=$oResponse->id;
$aOldAnswers=$oResponse->attributes; // Not needed but keep it
if(isset($oResponse->token) && $oResponse->token)
......@@ -241,7 +242,7 @@ class recomputeExpression extends PluginBase
if(!empty($equationAttribute) && !empty($equationAttribute->value)) {
$equation = $equationAttribute->value;
}
$newVal=$oResponse->$column=$this->this->_EMProcessString($equation);
$newVal=$oResponse->$column=$this->_EMProcessString($equation);
if($oldVal!=$newVal && ($oldVal && $newVal))
{
$updatedValues['old'][$sColumnName]=$oldVal;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment