Skip to content

Commit

Permalink
reset cloned registrations
Browse files Browse the repository at this point in the history
  • Loading branch information
juanSTIC committed Jul 5, 2024
1 parent 3ec67f1 commit a9c6aa2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/stic_Registrations/LogicHooksCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ public function before_save(&$bean, $event, $arguments) {
$bean->name = $subjectName . ' - ' . $eventName;
}

// If is a new record (cloned), reset calculated fields
if (!isset($bean->fetched_row)) {
$bean->attended_hours = null;
$bean->attendance_percentage = null;
}

}

public function after_save(&$bean, $event, $arguments) {
Expand Down

0 comments on commit a9c6aa2

Please sign in to comment.