From 9bd72fd9d5d7cf9f0a78359465f6d3bf6ea90547 Mon Sep 17 00:00:00 2001 From: Huong Nguyen Date: Thu, 12 Mar 2026 10:44:50 +0700 Subject: [PATCH] MDL-87708 tool_moodlenet: Remove post install task --- .../moodlenet/classes/task/post_install.php | 35 ------------------- public/admin/tool/moodlenet/db/install.php | 9 +---- 2 files changed, 1 insertion(+), 43 deletions(-) delete mode 100644 public/admin/tool/moodlenet/classes/task/post_install.php diff --git a/public/admin/tool/moodlenet/classes/task/post_install.php b/public/admin/tool/moodlenet/classes/task/post_install.php deleted file mode 100644 index 55f2ca13881..00000000000 --- a/public/admin/tool/moodlenet/classes/task/post_install.php +++ /dev/null @@ -1,35 +0,0 @@ -. - -declare(strict_types=1); - -namespace tool_moodlenet\task; - -/** - * Ad-hoc task to perform post install tasks. - * We use this to set the active activity chooser footer plugin to tool_moodlenet. - * We couldn't do this directly in install.php, because there is an admin_apply_default_settings() call after all plugins are - * installed and that would reset whatever value we had set earlier to 'hidden'. - * - * @package tool_moodlenet - * @copyright 2022 Shamim Rezaie - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ -class post_install extends \core\task\adhoc_task { - public function execute() { - set_config('activitychooseractivefooter', 'tool_moodlenet'); - } -} diff --git a/public/admin/tool/moodlenet/db/install.php b/public/admin/tool/moodlenet/db/install.php index d9c1a0f8669..4a43df97ceb 100644 --- a/public/admin/tool/moodlenet/db/install.php +++ b/public/admin/tool/moodlenet/db/install.php @@ -28,12 +28,5 @@ declare(strict_types=1); * Perform the post-install procedures. */ function xmldb_tool_moodlenet_install() { - // Use an ad-hoc task to set the active activity chooser footer plugin to tool_moodlenet. - // We couldn't do this in admin/settings/courses.php for 2 reasons: - // - First, because it would be a breach of component communications principles to do so there. - // - Second, because we can't call get_plugins_with_function() during install and upgrade (or it will return []). - // We couldn't do this directly here either, because there is an admin_apply_default_settings() call after all plugins are - // installed and that would reset whatever value we set here to 'hidden'. - $postinstall = new tool_moodlenet\task\post_install(); - core\task\manager::queue_adhoc_task($postinstall); + }