MDL-58744 blocks: Add system context block position in non user context.
This commit is contained in:
+5
-2
@@ -710,6 +710,8 @@ class block_manager {
|
||||
$ccjoin = "LEFT JOIN {context} ctx ON (ctx.instanceid = bi.id AND ctx.contextlevel = :contextlevel)";
|
||||
|
||||
$systemcontext = context_system::instance();
|
||||
list($bpcontext, $bpcontextidparams) = $DB->get_in_or_equal(array($context->id, $systemcontext->id),
|
||||
SQL_PARAMS_NAMED, 'bpcontextid');
|
||||
$params = array(
|
||||
'contextlevel' => CONTEXT_BLOCK,
|
||||
'subpage1' => $this->page->subpage,
|
||||
@@ -743,7 +745,7 @@ class block_manager {
|
||||
FROM {block_instances} bi
|
||||
JOIN {block} b ON bi.blockname = b.name
|
||||
LEFT JOIN {block_positions} bp ON bp.blockinstanceid = bi.id
|
||||
AND bp.contextid = :contextid1
|
||||
AND bp.contextid $bpcontext
|
||||
AND bp.pagetype = :pagetype
|
||||
AND bp.subpage = :subpage1
|
||||
$ccjoin
|
||||
@@ -761,7 +763,8 @@ class block_manager {
|
||||
COALESCE(bp.weight, bi.defaultweight),
|
||||
bi.id";
|
||||
|
||||
$allparams = $params + $parentcontextparams + $pagetypepatternparams + $requiredbythemeparams + $requiredbythemenotparams;
|
||||
$allparams = $params + $parentcontextparams + $pagetypepatternparams + $requiredbythemeparams;
|
||||
$allparams = $allparams + $requiredbythemenotparams + $bpcontextidparams;
|
||||
$blockinstances = $DB->get_recordset_sql($sql, $allparams);
|
||||
|
||||
$this->birecordsbyregion = $this->prepare_per_region_arrays();
|
||||
|
||||
Reference in New Issue
Block a user