Skip to content

Commit

Permalink
Fix bug breaking 'Repeat Entire Event'
Browse files Browse the repository at this point in the history
  • Loading branch information
mbentz committed Jun 29, 2021
1 parent 5fd13de commit 87244a0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ExternalModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,11 @@ function setDefaultValues() {
// Getting previous event value.
// isset returns true for event instances when $prev_event_field_value is equal to an empty string ("").
// An additional check to verify the value is not empty is required.
$source_form = ($_GET['instance'] > 1) ? $source_form : "";
$prev_event_field_value = $data[$prev_event][$source_field];
if (isset($prev_event_field_value) && !empty($prev_event_field_value)) {
$default_value = $prev_event_field_value;
} elseif ($data['repeat_instances'][$prev_event][$source_form]) {
} elseif (isset($data['repeat_instances'][$prev_event][$source_form])) {
// Handling repeat events by using the most recent instance of the previous event to source values
$most_recent_instance = array_slice($data['repeat_instances'][$prev_event][$source_form], -1)[0];
$default_value = $most_recent_instance[$source_field];
Expand Down

0 comments on commit 87244a0

Please sign in to comment.