Skip to content

Commit

Permalink
MDL-59629 mod_block: Set the default region in add_region
Browse files Browse the repository at this point in the history
Check and update default region in add_region if none set.
  • Loading branch information
Peter committed Dec 14, 2018
1 parent 33a388e commit 917a0e2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/blocklib.php
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,11 @@ public function add_region($region, $custom = true) {
}
}
$this->regions[$region] = 1;

// Checking the actual property instead of calling get_default_region as it ends up in a recursive call.
if (empty($this->defaultregion)) {
$this->set_default_region($region);
}
}

/**
Expand Down

0 comments on commit 917a0e2

Please sign in to comment.