Skip to content

Commit 80348fb

Browse files
committed
Merge branch 'release/3.3.3'
2 parents 7997fad + e5d0b9f commit 80348fb

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
All notable changes to the Form Render Skip Logic module will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## [3.3.3] - 2018-08-16
6+
### Changed
7+
- Fixing wrong behavior of "Control mode" field on config form: part II. (Tiago Bember Simeao)
8+
- Fixing wrong logic on 2.x - 3.x migration. (Tiago Bember Simeao)
9+
10+
511
## [3.3.2] - 2018-08-14
612
### Changed
713
- Fix wrong behavior of "Control mode" field on config form. (Tiago Bember Simeao)

ExternalModule.php

+8-5
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,16 @@ function redcap_module_system_change_version($version, $old_version) {
113113
continue;
114114
}
115115

116-
$conds = array_combine(
117-
$this->getProjectSetting('instrument_name', $pid),
118-
$this->getProjectSetting('control_field_value', $pid)
119-
);
116+
$forms = $this->getProjectSetting('instrument_name', $pid);
117+
$values = $this->getProjectSetting('control_field_value', $pid);
120118

121119
$bl = array();
122-
foreach ($conds as $form => $value) {
120+
foreach ($forms as $i => $form) {
121+
if (empty($form)) {
122+
continue;
123+
}
124+
125+
$value = $values[$i];
123126
if (!isset($bl[$value])) {
124127
$bl[$value] = array();
125128
}

js/config.js

+12-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,18 @@ $(document).ready(function() {
8282
var $checked = $(this).find('.external-modules-input-element:checked');
8383

8484
if ($checked.length === 0) {
85-
$checked = $(this).find('.external-modules-input-element[value="default"]');
85+
$(this).find('.external-modules-input-element').each(function() {
86+
// This is a workaround for an EM bug that does not load
87+
// radios default values properly.
88+
if (typeof this.attributes.checked !== 'undefined') {
89+
$checked = $(this);
90+
return false;
91+
}
92+
});
93+
94+
if ($checked.length === 0) {
95+
$checked = $(this).find('.external-modules-input-element[value="default"]');
96+
}
8697
}
8798

8899
branchingLogicRadios($checked);

0 commit comments

Comments
 (0)