Skip to content

Commit

Permalink
Fixed issue #16519: For specific screen navigation, condition is not …
Browse files Browse the repository at this point in the history
…saved properly

Resetting cqid when using token fields
  • Loading branch information
gabrieljenik authored and eddylackmann committed Jul 31, 2020
1 parent cdc1ddf commit 492a855
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
1 change: 1 addition & 0 deletions application/controllers/admin/conditionsaction.php
Expand Up @@ -685,6 +685,7 @@ protected function insertCondition(array $args)
$conditionCfieldname = $p_cquestions;
} elseif (isset($p_csrctoken) && $p_csrctoken != '') {
$conditionCfieldname = $p_csrctoken;
$p_cqid = 0; // Reset cqid if condition is based on token attribute
}

$condition_data = array(
Expand Down
4 changes: 0 additions & 4 deletions assets/scripts/admin/conditions.js
Expand Up @@ -130,10 +130,6 @@ $(document).on('ready pjax:scriptcomplete', function(){
p2.methodId = '#quick-add-method';
p2.canswersToSelectId= '#quick-add-canswersToSelectId';
$('#quick-add-cquestions').change(p2.fun);

$('#csrctoken').change(function() {
$('#cqid').val(0);
});

// At editing, if cquestions is set, populate answers
if ($('#cquestions').val() != '') {
Expand Down

0 comments on commit 492a855

Please sign in to comment.