Skip to content

Commit

Permalink
MDL-46147 modinfo: performance improvement for course page (check fil…
Browse files Browse the repository at this point in the history
…terall)
  • Loading branch information
marinaglancy committed Jul 1, 2014
1 parent 30e2727 commit 2522a17
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/modinfolib.php
Expand Up @@ -1319,14 +1319,17 @@ private function get_name() {
* @return string
*/
public function get_formatted_name($options = array()) {
global $CFG;
$options = (array)$options;
if (!isset($options['context'])) {
$options['context'] = $this->get_context();
}
// Improve filter performance by preloading filter setttings for all
// activities on the course (this does nothing if called multiple
// times).
filter_preload_activities($this->get_modinfo());
if (!empty($CFG->filterall)) {
filter_preload_activities($this->get_modinfo());
}
return format_string($this->get_name(), true, $options);
}

Expand Down

0 comments on commit 2522a17

Please sign in to comment.