Skip to content

Commit

Permalink
Fixed answer #16441: Problem in field type = List (Dropdown),
Browse files Browse the repository at this point in the history
The language attributes for the answer options were not retrieved.
Merged the answer attributes with the corresponding answerl10ns attributes in getQuestionArray (SurveyDynamic.php).
  • Loading branch information
gabrieljenik committed Aug 10, 2020
1 parent a520ff1 commit 67db44a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion application/models/SurveyDynamic.php
Expand Up @@ -900,7 +900,10 @@ public function getQuestionArray($oQuestion, $oResponses, $bHonorConditions, $su
});

if($oSelectedAnswerOption !== null){
$aQuestionAttributes['answeroption'] = $oSelectedAnswerOption->attributes;
$aQuestionAttributes['answeroption'] = array_merge(
$oSelectedAnswerOption->attributes,
$oSelectedAnswerOption->answerl10ns[$sLanguage]->attributes
);
} elseif ($oQuestion->other == 'Y'){
$aQuestionAttributes['answervalue'] = !empty($attributes['other_replace_text'][$sLanguage]) ? $attributes['other_replace_text'][$sLanguage] : gT("Other");
$aQuestionAttributes['answeroption']['answer'] = isset($oResponses[$fieldname.'other']) ? $oResponses[$fieldname.'other'] : null;
Expand Down

0 comments on commit 67db44a

Please sign in to comment.