Skip to content

Commit

Permalink
Merge branch 'release/3.3.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
pbchase committed Aug 16, 2018
2 parents 7997fad + e5d0b9f commit 80348fb
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
All notable changes to the Form Render Skip Logic module will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [3.3.3] - 2018-08-16
### Changed
- Fixing wrong behavior of "Control mode" field on config form: part II. (Tiago Bember Simeao)
- Fixing wrong logic on 2.x - 3.x migration. (Tiago Bember Simeao)


## [3.3.2] - 2018-08-14
### Changed
- Fix wrong behavior of "Control mode" field on config form. (Tiago Bember Simeao)
Expand Down
13 changes: 8 additions & 5 deletions ExternalModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,16 @@ function redcap_module_system_change_version($version, $old_version) {
continue;
}

$conds = array_combine(
$this->getProjectSetting('instrument_name', $pid),
$this->getProjectSetting('control_field_value', $pid)
);
$forms = $this->getProjectSetting('instrument_name', $pid);
$values = $this->getProjectSetting('control_field_value', $pid);

$bl = array();
foreach ($conds as $form => $value) {
foreach ($forms as $i => $form) {
if (empty($form)) {
continue;
}

$value = $values[$i];
if (!isset($bl[$value])) {
$bl[$value] = array();
}
Expand Down
13 changes: 12 additions & 1 deletion js/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,18 @@ $(document).ready(function() {
var $checked = $(this).find('.external-modules-input-element:checked');

if ($checked.length === 0) {
$checked = $(this).find('.external-modules-input-element[value="default"]');
$(this).find('.external-modules-input-element').each(function() {
// This is a workaround for an EM bug that does not load
// radios default values properly.
if (typeof this.attributes.checked !== 'undefined') {
$checked = $(this);
return false;
}
});

if ($checked.length === 0) {
$checked = $(this).find('.external-modules-input-element[value="default"]');
}
}

branchingLogicRadios($checked);
Expand Down

0 comments on commit 80348fb

Please sign in to comment.