From 2c2da240806b809300c6c04c5f4ca92ef11a8741 Mon Sep 17 00:00:00 2001 From: oliviervalentin Date: Mon, 3 Jun 2024 10:44:11 +0200 Subject: [PATCH] Minor fixes for codings styles - Moodle Code Checker --- classes/task/run_clean_reports_task.php | 7 ++++--- db/upgrade.php | 6 +++--- version.php | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/classes/task/run_clean_reports_task.php b/classes/task/run_clean_reports_task.php index d369547..a74fa4a 100644 --- a/classes/task/run_clean_reports_task.php +++ b/classes/task/run_clean_reports_task.php @@ -69,7 +69,7 @@ public function execute() { // Check if orphaned submissions is disabled, clean whole table. if (get_config('report_coursemanager', 'enable_orphans_task') == 0) { $purgereports = $DB->delete_records('report_coursemanager_orphans', []); - } + } // 2- Select all courses having reports in general reports table and check if course exists. $sqllistcourseswithreports = 'SELECT DISTINCT(course) AS courseid @@ -77,7 +77,7 @@ public function execute() { '; $listcourseswithreports = $DB->get_records_sql($sqllistcourseswithreports); - foreach($listcourseswithreports as $clean) { + foreach ($listcourseswithreports as $clean) { // If course doesn't exist (deleted by admin), delete all reports in tables. if (!$DB->record_exists('course', ['id' => $clean->courseid])) { $purgereports = $DB->delete_records('report_coursemanager_reports', ['course' => $clean->courseid]); @@ -94,7 +94,8 @@ public function execute() { $cm = get_coursemodule_from_id('assign', $assign->cmid); if (!$cm) { // If coursemodule not found, assign has probably been deleted. Delete report. - $purgereports = $DB->delete_records('report_coursemanager_orphans', ['course' => $assign->course, 'cmid' => $assign->cmid]); + $purgereports = $DB->delete_records('report_coursemanager_orphans', + ['course' => $assign->course, 'cmid' => $assign->cmid]); } } } diff --git a/db/upgrade.php b/db/upgrade.php index 3c3b0fa..d0c6d1d 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -112,10 +112,10 @@ function xmldb_report_coursemanager_upgrade($oldversion) { // HOTFIX : error in courses without teachers admin page. upgrade_plugin_savepoint(true, 2024050305, 'report', 'coursemanager'); } - if ($oldversion < 2024050309) { + if ($oldversion < 2024060301) { // Version 3.2.2. - // Add clkeaning task and fixes several bugs. - upgrade_plugin_savepoint(true, 2024050309, 'report', 'coursemanager'); + // Add cleaning task and fixes several bugs. + upgrade_plugin_savepoint(true, 2024060301, 'report', 'coursemanager'); } return true; } diff --git a/version.php b/version.php index 9968618..6759c8b 100644 --- a/version.php +++ b/version.php @@ -24,7 +24,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2024050309; +$plugin->version = 2024060301; $plugin->release = '3.2.2'; $plugin->requires = 2020061516; $plugin->component = 'report_coursemanager';