mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-30340 blocks - avoid lockin'blocks in subcontexts.
Everytime that one block instance is edited @ any subcontext, guarantee that the 'bring back' pattern (* = all pages) is available, so the block can be reseted to its original context
This commit is contained in:
parent
d0e016f53f
commit
b2221ee59c
1 changed files with 7 additions and 0 deletions
|
@ -1660,6 +1660,13 @@ function generate_page_type_patterns($pagetype, $parentcontext = null, $currentc
|
|||
$patterns = default_page_type_list($pagetype, $parentcontext, $currentcontext);
|
||||
}
|
||||
|
||||
// Ensure that the * pattern is always available if editing block 'at distance', so
|
||||
// we always can 'bring back' it to the original context. MDL-30340
|
||||
if ($currentcontext->id != $parentcontext->id && !isset($patterns['*'])) {
|
||||
// TODO: We could change the string here, showing its 'bring back' meaning
|
||||
$patterns['*'] = get_string('page-x', 'pagetype');
|
||||
}
|
||||
|
||||
return $patterns;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue