From 393f364fe894e509a77f64d346afe7bfb7da0eae Mon Sep 17 00:00:00 2001 From: David Watson <14983002+watson8@users.noreply.github.com> Date: Tue, 10 Sep 2024 11:34:03 +0100 Subject: [PATCH] CTP-3560 personal deadline table name --- classes/framework/table_base.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/classes/framework/table_base.php b/classes/framework/table_base.php index 06b93d57..a6bd857e 100644 --- a/classes/framework/table_base.php +++ b/classes/framework/table_base.php @@ -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; }