Skip to content

Commit

Permalink
CTP-3560 personal deadline table name
Browse files Browse the repository at this point in the history
  • Loading branch information
watson8 committed Sep 10, 2024
1 parent fcdeb97 commit 393f364
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion classes/framework/table_base.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,13 @@ public static final function get_table_name() {
$class_name = get_called_class(); // 'mod_coursework\models\deadline_extension'
$pieces = explode('\\', $class_name); // 'mod_coursework', 'models', 'deadline_extension'
$table_name = end($pieces); // 'deadline_extension'
$table_name .= 's'; // 'deadline_extensions'
//todo this may need further attention but fixing the one issue identified so far.
if ($table_name == 'personal_deadline') {
// Table personal_deadline does not exist but coursework_person_deadline does.
$table_name = 'coursework_person_deadline';
} else {
$table_name .= 's'; // 'deadline_extensions'
}
} else {
$table_name = static::$table_name;
}
Expand Down

0 comments on commit 393f364

Please sign in to comment.