Commit b24b88d5 authored by Aaron Wells's avatar Aaron Wells Committed by Robert Lyon
Browse files

"Recent journal entries" block for groups (Bug 1540156)

behatnotneeded

Change-Id: I2d67baea26986ac97e2744994f867f457e8c6298
parent 3259e459
......@@ -146,9 +146,6 @@ class PluginBlocktypeBlog extends MaharaCoreBlocktype {
// another View. We won't confuse users by asking them to choose a blog
// to put in this block, when the one that is currently in it isn't
// choosable.
//
// Note: the owner check will have to change when we do group/site
// blogs
if (empty($configdata['artefactid'])
|| (ArtefactTypeBlog::can_edit_blog($blog, $institution, $group))) {
$where = array('blog');
......
......@@ -96,10 +96,10 @@ class PluginBlocktypeRecentposts extends MaharaCoreBlocktype {
JOIN {artefact_blog_blogpost} ab ON (ab.blogpost = a.id AND ab.published = 1)
WHERE a.artefacttype = \'blogpost\'
AND a.parent IN ( ' . $artefactids . ' )
AND a.owner = (SELECT "owner" from {view} WHERE id = ?)
AND ' . $before . '
ORDER BY a.ctime DESC, a.id DESC
LIMIT ' . $limit, array($instance->get('view')));
LIMIT ' . $limit
);
if (!$mostrecent) {
$mostrecent = array();
}
......@@ -176,11 +176,10 @@ class PluginBlocktypeRecentposts extends MaharaCoreBlocktype {
}
/**
* Recentposts blocktype is only allowed in personal views, because
* currently there's no such thing as group/site blogs
* Blog blocktype is only allowed in personal / institution / group views
*/
public static function allowed_in_view(View $view) {
return $view->get('owner') != null;
return true;
}
}
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