Skip to content

Commit

Permalink
Fixed issue: Tokenattributedescription not used in token table
Browse files Browse the repository at this point in the history
  • Loading branch information
lacrioque committed Aug 15, 2018
1 parent 39208bb commit 56f41a0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions application/controllers/admin/tokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -1017,14 +1017,14 @@ public function managetokenattributes($iSurveyId)
$aData['thissurvey'] = $oSurvey->attributes;
$aData['surveyid'] = $iSurveyId;
$aData['tokenfields'] = getAttributeFieldNames($iSurveyId);
$aData['tokenfielddata'] = decodeTokenAttributes($oSurvey->attributedescriptions);
$aData['tokenfielddata'] = $oSurvey->decodedAttributedescriptions;
// Prepare token fiel list for dropDownList
$tokenfieldlist = array();
foreach ($aData['tokenfields'] as $tokenfield) {
if (isset($aData['tokenfielddata'][$tokenfield])) {
$description = $aData['tokenfielddata'][$tokenfield]['description'];
$description = $aData['tokenfielddata'][$tokenfield]['description'];
} else {
$description = "";
$description = "";
}
$description = sprintf(gT("Attribute %s (%s)"), str_replace("attribute_", "", $tokenfield), $description);
$tokenfieldlist[] = array("id"=>$tokenfield, "description"=>$description);
Expand Down
5 changes: 4 additions & 1 deletion application/models/Survey.php
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,10 @@ public function getTokenAttributes()
$allKnowAttributes = $attdescriptiondata;
// Without token table : all attribute $this->attributedescriptions AND real attribute. @see issue #13924
if($this->getHasTokensTable()){
$allKnowAttributes = array_intersect_key(array_merge($attdescriptiondata,Token::model($this->sid)->getAttributes()),Token::model($this->sid)->getAttributes());
$allKnowAttributes = array_intersect_key(
( $attdescriptiondata + Token::model($this->sid)->getAttributes()),
Token::model($this->sid)->getAttributes()
);
// We remove deleted attribute even if deleted manually in DB
}
$aCompleteData = array();
Expand Down

0 comments on commit 56f41a0

Please sign in to comment.