You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug fix for filter logic handling when instance table of current form.
Change in v1.10.0 where references in filter data on current form does not work - is not required - when instance table is of the same form the user is viewing.
@@ -527,9 +527,10 @@ public function getInstanceData($record, $event, $form, $fields, $filter, $inclu
527
527
528
528
if ($includeFormStatus) { $fields[] = $form.'_complete'; }
529
529
530
-
if (!empty($filter)) {
531
-
// if context for instance table is a repeating form/event then replace any references to fields in this context in the logic expression with their current values
532
-
// this prevents [current-instance] being automatically added by LogicTester::preformatLogicEventInstanceSmartVariable()
530
+
if ($form!=$formViewContext && !empty($filter)) {
531
+
// if instance table of a repeating form/event is being viewed on a (different) repeating form/event
532
+
// then replace any references to fields from the current view context in the logic expression with their current values
533
+
// this prevents [current-instance] being automatically added by LogicTester::preformatLogicEventInstanceSmartVariables()
533
534
// and enables the filter to pick up instances of another form with values that match something in the current repeating context
@@ -1080,8 +1081,9 @@ public function redcap_every_page_before_render($project_id) {
1080
1081
1081
1082
/**
1082
1083
* replaceRepeatingContextValuesInLogicWithValues
1083
-
* if context for instance table is a repeating form/event then replace any references to fields in this context in the logic expression with their current values
1084
-
* this prevents [current-instance] being automatically added by LogicTester::preformatLogicEventInstanceSmartVariable()
1084
+
* if instance table of a repeating form/event is being viewed on a (different) repeating form/event
1085
+
* then replace any references to fields from the current view context in the logic expression with their current values
1086
+
* this prevents [current-instance] being automatically added by LogicTester::preformatLogicEventInstanceSmartVariables()
1085
1087
* and enables the filter to pick up instances of another form with values that match something in the current repeating context
1086
1088
* @param string $filter
1087
1089
* @return string
@@ -1109,18 +1111,18 @@ protected function replaceRepeatingContextValuesInLogicWithValues(string $filter
0 commit comments