Skip to content

Commit

Permalink
Dev: fix array_keys() expects parameter 1 to be array, object given /…
Browse files Browse the repository at this point in the history
…application/helpers/expressions/em_manager_helper.php(3473)

Dev: put attributes array in $_SESSION['survey_'.$surveyid]['thistoken']
Dev: @SamMousa : see comment 0f17969#commitcomment-4139555
Dev: please, review, seems fixed, but maybe add a new function in model (to use static and cache) is a good idea
  • Loading branch information
Shnoulle committed Sep 20, 2013
1 parent 6206e87 commit 71a9cf0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion application/helpers/expressions/em_manager_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -3460,7 +3460,7 @@ private function setVariableAndTokenMappingsForExpressionManager($surveyid,$forc
if (isset($_SESSION[$this->sessid]['token']) && $_SESSION[$this->sessid]['token'] != '')
{
//Gather survey data for tokenised surveys, for use in presenting questions
$_SESSION[$this->sessid]['thistoken'] = Token::model($surveyid)->findByToken($_SESSION[$this->sessid]['token']);
$_SESSION[$this->sessid]['thistoken'] = Token::model($surveyid)->findByToken($_SESSION[$this->sessid]['token'])->attributes;
$this->knownVars['TOKEN:TOKEN'] = array(
'code'=>$_SESSION[$this->sessid]['token'],
'jsName_on'=>'',
Expand Down
2 changes: 1 addition & 1 deletion application/helpers/frontend_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,7 @@ function buildsurveysession($surveyid,$preview=false)
if ($tokensexist == 1 && $thissurvey['anonymized'] == "N" && tableExists('{{tokens_'.$surveyid.'}}'))
{
//Gather survey data for "non anonymous" surveys, for use in presenting questions
$_SESSION['survey_'.$surveyid]['thistoken'] = Token::model($surveyid)->findByToken($clienttoken);
$_SESSION['survey_'.$surveyid]['thistoken'] = Token::model($surveyid)->findByToken($clienttoken)->attributes;
}
$qtypes=getQuestionTypeList('','array');
$fieldmap=createFieldMap($surveyid,'full',true,false,$_SESSION['survey_'.$surveyid]['s_lang']);
Expand Down

0 comments on commit 71a9cf0

Please sign in to comment.