Permalink
Browse files

Merge branch 'MDL-58744-33' of https://github.com/jacac/moodle into M…

…OODLE_33_STABLE
  • Loading branch information...
dmonllao committed Jul 31, 2017
2 parents dd4855c + c2de62b commit db495bf3a05d8872745404395c1a57ad80224b4d
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/blocklib.php
@@ -728,6 +728,8 @@ public function load_blocks($includeinvisible = null) {
$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,
@@ -761,7 +763,7 @@ public function load_blocks($includeinvisible = null) {
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
@@ -779,7 +781,8 @@ public function load_blocks($includeinvisible = null) {
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();

0 comments on commit db495bf

Please sign in to comment.