Commit b86741d1 authored by Robert Lyon's avatar Robert Lyon

Bug 1515484: The my views block on dashboard had broken pagination

It was trying to pass an unset $userid - which should really be the
owner of the dashboard page's id

behatnotneeded

Change-Id: I8886f37275b0b7ff9be823a0c3f2b271baf67afc
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 25a7b701
......@@ -19,9 +19,11 @@ safe_require('artefact', 'blog');
$blogs = (object) array(
'offset' => param_integer('offset', 0),
'limit' => param_integer('limit', 10),
'institution' => param_alpha('institution', null),
'group' => param_integer('group', null),
);
list($blogs->count, $blogs->data) = ArtefactTypeBlog::get_blog_list($blogs->limit, $blogs->offset);
list($blogs->count, $blogs->data) = ArtefactTypeBlog::get_blog_list($blogs->limit, $blogs->offset, $blogs->institution, $blogs->group);
ArtefactTypeBlog::build_blog_list_html($blogs);
json_reply(false, array('data' => $blogs));
......@@ -406,6 +406,7 @@ class ArtefactTypeBlog extends ArtefactType {
'count' => $blogs->count,
'limit' => $blogs->limit,
'offset' => $blogs->offset,
'setlimit' => true,
'firsttext' => '',
'previoustext' => '',
'nexttext' => '',
......
......@@ -31,11 +31,11 @@ $dashboard = new View($viewid);
if (!can_view_view($dashboard)) {
json_reply(true, get_string('accessdenied', 'error'));
}
$userid = $USER->get('id');
$views = View::view_search(
null, // $query
null, // $ownerquery
(object) array('owner' => $userid), // $ownedby
(object) array('owner' => $dashboard->get('owner')), // $ownedby
null, // $copyableby
10, // $limit
$offset, // $offset
......
......@@ -8,9 +8,11 @@
{if !$blogs->data}
<p class="no-results">{str tag=youhavenoblogs section=artefact.blog}</p>
{else}
<div id="bloglist" class="rel view-container">
<div class="rel view-container">
<div class="panel-items js-masonry" data-masonry-options='{ "itemSelector": ".panel" }'>
{$blogs->tablerows|safe}
<div id="bloglist">
{$blogs->tablerows|safe}
</div>
</div>
{$blogs->pagination|safe}
</div>
......
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