Skip to content

Commit

Permalink
Fixed issue #CT-778: Wrong placeholder field codes in html editor
Browse files Browse the repository at this point in the history
  • Loading branch information
twilligls committed May 15, 2024
1 parent 632e9e7 commit 9efa851
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
20 changes: 19 additions & 1 deletion application/controllers/LimereplacementfieldsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,26 @@ private function getChildQuestions(array $questions)
$question = "[{$row['subquestion2']}] " . $question;
}

$replacementCode = $row['title'];
if (array_key_exists('aid', $row) && $row['aid'] !== '') {
$replacementCode = $row['title'] . '_' . $row['aid'];
if (array_key_exists('scale_id', $row)) {
$replacementCode = $replacementCode . '_' . $row['scale_id'];
}
if (strpos($replacementCode, '_other') === false) {
$replacementCode = $replacementCode . '.shown';
}
}
$shortquestion = $row['title'] . ": " . flattenText($question);
$cquestions[] = array($shortquestion, $row['qid'], $row['type'], $row['fieldname'], $row['previouspage'], $row['title']);
$cquestions[] = array(
$shortquestion,
$row['qid'],
$row['type'],
$row['fieldname'],
$row['previouspage'],
$row['title'],
$replacementCode
);
}
return $cquestions;
}
Expand Down
2 changes: 1 addition & 1 deletion application/helpers/expressions/em_manager_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -8632,7 +8632,7 @@ private function _GetVarAttribute($name, $attr, $default, $gseq, $qseq)
// NB: No break needed
case 'code':
case 'NAOK':
if (isset($var['code'])) {
if (array_key_exists('code', $var) && isset($var['code'])) {
return $var['code']; // for static values like TOKEN
} else {
if (isset($_SESSION[$this->sessid][$sgqa])) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function Ok()
$isDisabled = " disabled='disabled'";
}
?>
<option value='<?php echo $cqn[5];?>.shown' title='<?php echo $cqn[0];?>' <?php echo $isDisabled;?>><?php echo $cqn[0];?></option>
<option value='<?php echo $cqn[6];?>' title='<?php echo $cqn[0];?>' <?php echo $isDisabled;?>><?php echo $cqn[0];?></option>
<?php
}
?>
Expand Down

0 comments on commit 9efa851

Please sign in to comment.