Commit fa352eff authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1493199: Restrict latest views block to others content only



behatnotneeded

Change-Id: I46e5cabeb397fafc6f2ed5d47e5b5401043a73c2
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 143ac528
...@@ -34,7 +34,7 @@ class PluginBlocktypeNewViews extends MaharaCoreBlocktype { ...@@ -34,7 +34,7 @@ class PluginBlocktypeNewViews extends MaharaCoreBlocktype {
require_once('view.php'); require_once('view.php');
$configdata = $instance->get('configdata'); $configdata = $instance->get('configdata');
$nviews = isset($configdata['limit']) ? intval($configdata['limit']) : 5; $nviews = isset($configdata['limit']) ? intval($configdata['limit']) : 5;
$view = $instance->get_view();
$sort = array(array('column' => 'mtime', 'desc' => true)); $sort = array(array('column' => 'mtime', 'desc' => true));
$views = View::view_search( $views = View::view_search(
null, // $query null, // $query
...@@ -50,7 +50,7 @@ class PluginBlocktypeNewViews extends MaharaCoreBlocktype { ...@@ -50,7 +50,7 @@ class PluginBlocktypeNewViews extends MaharaCoreBlocktype {
null, // $accesstypes null, // $accesstypes
null, // $tag null, // $tag
null, // $viewid null, // $viewid
null, // $excludeowner $view->get('owner'), // $excludeowner
true // $groupbycollection true // $groupbycollection
); );
$smarty = smarty_core(); $smarty = smarty_core();
......
...@@ -12,6 +12,7 @@ Background: ...@@ -12,6 +12,7 @@ Background:
Given the following "permissions" exist: Given the following "permissions" exist:
| title | accesstype | accessname | allowcomments | approvecomments | | title | accesstype | accessname | allowcomments | approvecomments |
| page1 | public | public | 1 | 0 | | page1 | public | public | 1 | 0 |
| page2 | loggedin | loggedin | 1 | 0 |
Scenario: Adding and deleting public comments Scenario: Adding and deleting public comments
# Adding # Adding
...@@ -48,7 +49,7 @@ Scenario: Adding and deleting public comments ...@@ -48,7 +49,7 @@ Scenario: Adding and deleting public comments
And I should not see "Comment removed" And I should not see "Comment removed"
Scenario: Comments update the page's mtime Scenario: Comments update the page's mtime
Given I log in as "pageowner" with password "password" Given I log in as "admin" with password "Kupuhipa1"
# Set New Views to only show me the most recently updated page # Set New Views to only show me the most recently updated page
And I follow "Edit dashboard" And I follow "Edit dashboard"
......
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