diff --git a/.upgradenotes/MDL-87034-2025102912420312.yml b/.upgradenotes/MDL-87034-2025102912420312.yml new file mode 100644 index 00000000000..f43bce675b2 --- /dev/null +++ b/.upgradenotes/MDL-87034-2025102912420312.yml @@ -0,0 +1,9 @@ +issueNumber: MDL-87034 +notes: + core_webservice: + - message: >- + The WebService core_webservice_get_site_info now returns three new fields: + "usercanviewconfig" indicating whether the current user can see the + administration tree, "usercanchangeconfig" indicating whether the + current user can change the site configuration, and site secret. + type: changed diff --git a/public/lib/classes/hub/registration.php b/public/lib/classes/hub/registration.php index 6d9904d8646..b99c8b912fc 100644 --- a/public/lib/classes/hub/registration.php +++ b/public/lib/classes/hub/registration.php @@ -961,4 +961,11 @@ class registration { $size = $size / (1024 * 1024); return round($size, 3); } + + /** + * Resets the static caches for unit tests. + */ + public static function reset_caches(): void { + self::$registration = null; + } } diff --git a/public/lib/phpunit/classes/util.php b/public/lib/phpunit/classes/util.php index fc295db0d33..c6b2e3c1ccf 100644 --- a/public/lib/phpunit/classes/util.php +++ b/public/lib/phpunit/classes/util.php @@ -245,6 +245,9 @@ class phpunit_util extends testing_util { core_calendar\local\event\container::reset_caches(); } + // Reset hub registration caches. + \core\hub\registration::reset_caches(); + // TODO MDL-25290: add more resets here and probably refactor them to new core function. // Reset course and module caches. diff --git a/public/mod/forum/tests/mail_test.php b/public/mod/forum/tests/mail_test.php index fda0e8f5e42..90a9e98b5c2 100644 --- a/public/mod/forum/tests/mail_test.php +++ b/public/mod/forum/tests/mail_test.php @@ -1043,7 +1043,7 @@ final class mail_test extends \advanced_testcase { $htmlbase['user']['mailformat'] = 1; $htmlbase['expectations'][0]['contents'] = array( '~{\$a', - '~&(amp|lt|gt|quot|\#039);(?!course|lang|version|iosappid|androidappid)', + '~&(amp|lt|gt|quot|\#039);(?!course|lang|version|iosappid|androidappid|siteurl)', '