Merge branch 'MDL-87017-405-frontpage-block-any-page' of https://github.com/danowar2k/moodle into MOODLE_405_STABLE

This commit is contained in:
Huong Nguyen
2025-11-25 10:42:22 +07:00
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -1469,7 +1469,7 @@ class block_manager {
if ($parentcontext->id != $systemcontext->id && is_inside_frontpage($parentcontext)) {
$messagestring->pagetype = get_string('showonfrontpageandsubs', 'block');
} else {
$pagetypes = generate_page_type_patterns($this->page->pagetype, $parentcontext);
$pagetypes = generate_page_type_patterns($this->page->pagetype, $parentcontext, $this->page->context);
$messagestring->pagetype = $block->instance->pagetypepattern;
if (isset($pagetypes[$block->instance->pagetypepattern])) {
$messagestring->pagetype = $pagetypes[$block->instance->pagetypepattern];
@@ -1686,7 +1686,7 @@ class block_manager {
if ($parentcontext->id != $systemcontext->id && is_inside_frontpage($parentcontext)) {
$messagestring->pagetype = get_string('showonfrontpageandsubs', 'block');
} else {
$pagetypes = generate_page_type_patterns($this->page->pagetype, $parentcontext);
$pagetypes = generate_page_type_patterns($this->page->pagetype, $parentcontext, $this->page->context);
$messagestring->pagetype = $block->instance->pagetypepattern;
if (isset($pagetypes[$block->instance->pagetypepattern])) {
$messagestring->pagetype = $pagetypes[$block->instance->pagetypepattern];
+1 -1
View File
@@ -1946,7 +1946,7 @@ function question_page_type_list($pagetype, $parentcontext, $currentcontext): ar
'question-export' => get_string('page-question-export', 'question'),
'question-import' => get_string('page-question-import', 'question')
];
if ($currentcontext->contextlevel == CONTEXT_COURSE) {
if ($currentcontext && $currentcontext->contextlevel == CONTEXT_COURSE) {
require_once($CFG->dirroot . '/course/lib.php');
return array_merge(course_page_type_list($pagetype, $parentcontext, $currentcontext), $types);
} else {