Skip to content

Commit

Permalink
The member function _getTokenIds in application/controllers/admin/tok…
Browse files Browse the repository at this point in the history
…ens.php references a $iSurveyId variable which is not declared or initialised anywhere. The only reference to the function seems to be on line 1022, where such a variable is available. Adjusting the method to take an extra survey Id parameter seems to fix the problem I encountered when working with tokens in v2.0b1
  • Loading branch information
fmestrone committed Apr 26, 2012
1 parent b70dd07 commit 259768e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/controllers/admin/tokens.php
Expand Up @@ -1019,7 +1019,7 @@ function email($iSurveyId, $aTokenIds = null)
$aSurveyLangs = Survey::model()->findByPk($iSurveyId)->additionalLanguages;
$sBaseLanguage = Survey::model()->findByPk($iSurveyId)->language;
array_unshift($aSurveyLangs, $sBaseLanguage);
$aTokenIds = $this->_getTokenIds($aTokenIds);
$aTokenIds = $this->_getTokenIds($aTokenIds, $iSurveyId);
$aTokenFields = getTokenFieldsAndNames($iSurveyId, true);
$iAttributes = 0;
if (getEmailFormat($iSurveyId) == 'html')
Expand Down Expand Up @@ -2022,7 +2022,7 @@ function _handletokenform($iSurveyId, $subaction, $iTokenId="")
$this->_renderWrappedTemplate('token', array('tokenbar', 'tokenform'), $aData);
}

private function _getTokenIds($aTokenIds)
private function _getTokenIds($aTokenIds, $iSurveyId)
{
// CHECK TO SEE IF A TOKEN TABLE EXISTS FOR THIS SURVEY
$bTokenExists = tableExists('{{tokens_' . $iSurveyId . '}}');
Expand Down

0 comments on commit 259768e

Please sign in to comment.