Skip to content

Commit

Permalink
Fixed issue #15726: localized question attributes not displayed corre…
Browse files Browse the repository at this point in the history
…ctly in the questioneditor
  • Loading branch information
ptelu committed Jan 28, 2020
1 parent 791baeb commit 3d961a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions application/models/QuestionAttribute.php
Expand Up @@ -218,7 +218,7 @@ public function getQuestionAttributes($iQuestionID, $sLanguage = null)

// Limit the size of the attribute cache due to memory usage
$aQuestionAttributes = array();
$oQuestion = Question::model()->find("qid=:qid", array('qid'=>$iQuestionID)); // Maybe take parent_qid attribute before this qid attribute
$oQuestion = Question::model()->with('survey')->find("qid=:qid", array('qid'=>$iQuestionID)); // Maybe take parent_qid attribute before this qid attribute

if ($oQuestion) {
if ($sLanguage) {
Expand All @@ -237,7 +237,7 @@ public function getQuestionAttributes($iQuestionID, $sLanguage = null)
$aAttributeNames = self::getQuestionAttributesSettings($sType);

/* Get whole existing attribute for this question in an array*/
$oAttributeValues = self::model()->findAll("qid=:qid", array('qid'=>$iQuestionID));
$oAttributeValues = self::model()->resetScope()->findAll("qid=:qid", ['qid' => $iQuestionID]);

// insert additional attributes from an extended question theme
foreach ($oAttributeValues as $oAttributeValue) {
Expand Down
2 changes: 1 addition & 1 deletion application/models/QuestionBaseDataSet.php
Expand Up @@ -115,7 +115,7 @@ public function getAdvancedOptions($iQuestionID = null, $sQuestionType = null, $

$this->sQuestionType = $sQuestionType == null ? $this->oQuestion->type : $sQuestionType;
$this->sLanguage = $sLanguage == null ? $this->oQuestion->survey->language : $sLanguage;
$this->aQuestionAttributes = QuestionAttribute::model()->getQuestionAttributes($this->oQuestion->qid, $this->sLanguage);
$this->aQuestionAttributes = QuestionAttribute::model()->getQuestionAttributes($this->oQuestion->qid, $sLanguage);

$sQuestionType = $this->sQuestionType;

Expand Down

0 comments on commit 3d961a4

Please sign in to comment.