mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Merge branch 'MDL-72413-performance-patch' of https://github.com/ilyatregubov/moodle
This commit is contained in:
commit
c304a77326
3 changed files with 4 additions and 1 deletions
|
@ -1403,7 +1403,7 @@ class core_renderer extends renderer_base {
|
|||
$this->page->set_state(moodle_page::STATE_IN_BODY);
|
||||
|
||||
// If an activity record has been set, activity_header will handle this.
|
||||
if (!$this->page->activityrecord || !empty($this->page->layout_options['noactivityheader'])) {
|
||||
if (!$this->page->cm || !empty($this->page->layout_options['noactivityheader'])) {
|
||||
$header .= $this->skip_link_target('maincontent');
|
||||
}
|
||||
return $header;
|
||||
|
|
|
@ -75,6 +75,8 @@ $forumrecord = $forumdatamapper->to_legacy_object($forum);
|
|||
$discussiondatamapper = $datamapperfactory->get_discussion_data_mapper();
|
||||
$discussionrecord = $discussiondatamapper->to_legacy_object($discussion);
|
||||
$discussionviewurl = $urlfactory->get_discussion_view_url_from_discussion($discussion);
|
||||
// Set the activity record, to avoid additional calls to the db if the page getter is called.
|
||||
$PAGE->set_activity_record($forumrecord);
|
||||
|
||||
// move this down fix for MDL-6926
|
||||
require_once($CFG->dirroot . '/mod/forum/lib.php');
|
||||
|
|
|
@ -139,6 +139,7 @@ if (!$capabilitymanager->can_view_discussions($USER)) {
|
|||
// Mark viewed and trigger the course_module_viewed event.
|
||||
$forumdatamapper = $legacydatamapperfactory->get_forum_data_mapper();
|
||||
$forumrecord = $forumdatamapper->to_legacy_object($forum);
|
||||
$PAGE->set_activity_record($forumrecord);
|
||||
forum_view(
|
||||
$forumrecord,
|
||||
$forum->get_course_record(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue