mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
calendar: performance optimisations + behaviour fix (MDL-7416 MDL-9617)
With 2500 courses the calendar was causing around 15000 queries at login and 5000 on the home page. - Replaced queries inside loops with single unlooped queries. - Fixed calendar so that course events will show when the users role is assigned at a category level. - Moved calendar_session_vars() function call out of calendar/lib.php (including a lib should not have side effects) Author: Matt Clarkson - with some conflict resolution from MartinL
This commit is contained in:
parent
f261e052f2
commit
37d87d11f9
8 changed files with 39 additions and 16 deletions
|
@ -20,7 +20,9 @@ class block_calendar_month extends block_base {
|
|||
if ($this->content !== NULL) {
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
// Initialize the session variables
|
||||
calendar_session_vars();
|
||||
|
||||
$this->content = new stdClass;
|
||||
$this->content->text = '';
|
||||
$this->content->footer = '';
|
||||
|
|
|
@ -16,7 +16,8 @@ class block_calendar_upcoming extends block_base {
|
|||
if ($this->content !== NULL) {
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
// Initialize the session variables
|
||||
calendar_session_vars();
|
||||
$this->content = new stdClass;
|
||||
$this->content->text = '';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue