mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-30540 - BLOG - Fixing context problems for single blog entries - Thanks Aparup and Sam for the help
This commit is contained in:
parent
baa5cd8240
commit
ae6313d4a7
@ -197,20 +197,18 @@ if (!empty($userid)) {
|
||||
|
||||
$courseid = (empty($courseid)) ? SITEID : $courseid;
|
||||
|
||||
if (!empty($courseid)) {
|
||||
$PAGE->set_context(get_context_instance(CONTEXT_COURSE, $courseid));
|
||||
}
|
||||
|
||||
if (!empty($modid)) {
|
||||
$PAGE->set_context(get_context_instance(CONTEXT_MODULE, $modid));
|
||||
if (empty($entryid) && empty($modid) && empty($groupid)) {
|
||||
$PAGE->set_context(context_user::instance($USER->id));
|
||||
} else if (!empty($modid)) {
|
||||
$PAGE->set_context(context_module::instance($modid));
|
||||
} else if (!empty($courseid)) {
|
||||
$PAGE->set_context(context_course::instance($courseid));
|
||||
} else {
|
||||
$PAGE->set_context(context_system::instance());
|
||||
}
|
||||
|
||||
$blogheaders = blog_get_headers();
|
||||
|
||||
if (empty($entryid) && empty($modid) && empty($groupid)) {
|
||||
$PAGE->set_context(get_context_instance(CONTEXT_USER, $USER->id));
|
||||
}
|
||||
|
||||
if ($CFG->enablerssfeeds) {
|
||||
$rsscontext = null;
|
||||
$filtertype = null;
|
||||
|
@ -314,7 +314,7 @@ function blog_get_context_url($context=null) {
|
||||
|
||||
// Change contextlevel to SYSTEM if viewing the site course
|
||||
if ($context->contextlevel == CONTEXT_COURSE && $context->instanceid == SITEID) {
|
||||
$context->contextlevel = CONTEXT_SYSTEM;
|
||||
$context = context_system::instance();
|
||||
}
|
||||
|
||||
$filterparam = '';
|
||||
|
Loading…
x
Reference in New Issue
Block a user