Commit 801d39cc authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Fix malformed block pagination urls when clean urls are enabled



The blog and friends blocks assumed that the view urls contained a
query string.  This is no longer true when clean urls are enabled.

Change-Id: Iafae1c7b51fc3a82d131a1c8993ea7cad21bb9fc
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 2abd5870
......@@ -79,8 +79,10 @@ class PluginBlocktypeBlog extends PluginBlocktype {
$pagination = false;
}
else {
$baseurl = $instance->get_view()->get_url();
$baseurl .= (strpos($baseurl, '?') === false ? '?' : '&') . 'block=' . $instance->get('id');
$pagination = array(
'baseurl' => $instance->get_view()->get_url() . '&block=' . $instance->get('id'),
'baseurl' => $baseurl,
'id' => 'blogpost_pagination_' . $instance->get('id'),
'datatable' => 'postlist_' . $instance->get('id'),
'jsonscript' => 'artefact/blog/posts.json.php',
......
......@@ -47,8 +47,10 @@ if ($blockid = param_integer('block', null)) {
$configdata['viewid'] = $bi->get('view');
$posts = ArtefactTypeBlogpost::get_posts($configdata['artefactid'], $limit, $offset, $configdata);
$template = 'artefact:blog:viewposts.tpl';
$baseurl = $bi->get_view()->get_url();
$baseurl .= (strpos($baseurl, '?') === false ? '?' : '&') . 'block=' . $blockid;
$pagination = array(
'baseurl' => $bi->get_view()->get_url() . '&block=' . $blockid,
'baseurl' => $baseurl,
'id' => 'blogpost_pagination_' . $blockid,
'datatable' => 'postlist_' . $blockid,
'jsonscript' => 'artefact/blog/posts.json.php',
......
......@@ -61,7 +61,8 @@ class PluginBlocktypeMyfriends extends SystemBlocktype {
return;
}
$baseurl = $instance->get_view()->get_url() . '&block=' . $instance->get('id');
$baseurl = $instance->get_view()->get_url();
$baseurl .= (strpos($baseurl, '?') === false ? '?' : '&') . 'block=' . $instance->get('id');
$baseurl .= '&user=' . (int) $userid;
$pagination = build_pagination(array(
'id' => 'userfriendstable_pagination',
......
Supports Markdown
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