From 609e99b5cd4822b129a0286cef87635ac7db6c4a Mon Sep 17 00:00:00 2001 From: Juan Leyva Date: Tue, 14 Mar 2023 12:34:41 +0100 Subject: [PATCH] MDL-73670 block: Remove hack to force returning the overview block --- blocks/classes/external.php | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/blocks/classes/external.php b/blocks/classes/external.php index 0d6fc224b0b..ccb3152055e 100644 --- a/blocks/classes/external.php +++ b/blocks/classes/external.php @@ -290,34 +290,6 @@ class core_block_external extends external_api { $returninvisible = has_capability('moodle/my:manageblocks', $context) ? true : false; $allblocks = self::get_all_current_page_blocks($returninvisible, $params['returncontents']); - // Temporary hack to be removed in 4.1. - // Return always the course overview block so old versions of the app can list the user courses. - if ($mypage == MY_PAGE_DEFAULT && core_useragent::is_moodle_app()) { - $myoverviewfound = false; - - foreach ($allblocks as $block) { - if ($block['name'] == 'myoverview' && $block['visible']) { - $myoverviewfound = true; - break; - } - } - - if (!$myoverviewfound) { - // Include a course overview fake block. - $allblocks[] = [ - 'instanceid' => 0, - 'name' => 'myoverview', - 'region' => 'forced', - 'positionid' => null, - 'collapsible' => true, - 'dockable' => false, - 'weight' => 0, - 'visible' => true, - ]; - } - } - // End of the hack to be removed in 4.1 see MDL-73670. - return array( 'blocks' => $allblocks, 'warnings' => $warnings