Commit d6db4801 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review

Merge "Bug 1636599: Avoid infinite redirect with user journals pages" into 15.10_STABLE

parents 96eb99a5 047ae8ff
......@@ -80,9 +80,17 @@ list($blogs->count, $blogs->data) = ArtefactTypeBlog::get_blog_list($blogs->limi
if (empty($blogs->institution) && empty($blogs->group)) {
if (!$USER->get_account_preference('multipleblogs')) {
$extra = !empty($institution) ? '?institution=' . $institution : '';
$extra = !empty($group) ? '?group=' . $group : '';
redirect(get_config('wwwroot') . 'artefact/blog/view/index.php' . $extra);
// Check to see if the user has multiple blogs anyway
$records = get_records_select_array('artefact', "artefacttype = 'blog' AND \"owner\" = ?", array($USER->get('id')), 'id ASC');
if ($records && count($records) > 1) {
set_account_preference($USER->get('id'), 'multipleblogs', 1);
$USER->set_account_preference('multipleblogs', 1);
}
else {
$extra = !empty($institution) ? '?institution=' . $institution : '';
$extra = !empty($group) ? '?group=' . $group : '';
redirect(get_config('wwwroot') . 'artefact/blog/view/index.php' . $extra);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment