From a1c0b98c1de73f56e7ffe912dfa4ca60db0475d0 Mon Sep 17 00:00:00 2001
From: Jun Pataleta <jun@moodle.com>
Date: Thu, 5 May 2022 01:37:04 +0800
Subject: [PATCH] MDL-74317 blocks: Revert checking of block usage against page
 format

---
 blocks/moodleblock.class.php | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/blocks/moodleblock.class.php b/blocks/moodleblock.class.php
index 3a13521de93..9d0a21273c6 100644
--- a/blocks/moodleblock.class.php
+++ b/blocks/moodleblock.class.php
@@ -629,12 +629,10 @@ class block_base {
                        && has_capability('moodle/my:manageblocks', $page->context);
             }
         }
-        // Check if this is a block only used on 'my' or 'user' page types.
-        foreach (array_keys($mypagetypes + $userpagetypes) as $key) {
-            unset($formats[$key]);
-        }
+        // Check if this is a block only used on /my.
+        unset($formats['my']);
         if (empty($formats)) {
-            // Block can only be added to 'my' or 'user' page types - return false.
+            // Block can only be added to /my - return false.
             return false;
         }