Skip to content

Commit

Permalink
Fixed issue #17386: Missing curly brackets for expression input field(#…
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieljenik committed Jul 9, 2021
1 parent 16525b4 commit 9a09ecb
Showing 1 changed file with 9 additions and 0 deletions.
Expand Up @@ -19,6 +19,15 @@ public function run()
//if ($this->setting['inputtype'] === 'singleselect') {
//echo '<pre>'; var_dump($this->setting['aFormElementOptions']['options']); echo '</pre>';
//}

// The 'expression' property comes from the question attribute definition (either from the theme's config.xml
// or from newQuestionAttributes() plugin event).
// The value 2 indicates that the attribute must be treated as an EM expression (survey logic file and question
// summary automatically add the brackets before evaluation).
if (isset($this->setting['expression']) && $this->setting['expression'] == 2) {
$this->setting['aFormElementOptions']['inputGroup'] = ['prefix' => '{', 'suffix' => '}'];
}

$content = $this->render($this->setting['inputtype'], null, true);
$this->render('layout', ['content' => $content]);
}
Expand Down

0 comments on commit 9a09ecb

Please sign in to comment.