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

Bug 1527456: removing the last remnants of the accessconf stuff

This got added in 2010 via
commit 87a2c5f2



but we don't need it now, and will end up complicating the ability to
do views in multiple collections, so will remove

behatnotneeded  - existing tests should cover

Change-Id: Ie39a72442cae10727bf9f26ed86050e66e7df4bd
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
Signed-off-by: Aaron Wells's avatarAaron Wells <aaronw@catalyst.net.nz>
parent cd9247b4
......@@ -793,7 +793,6 @@
<FIELD NAME="visits" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" />
<FIELD NAME="allowcomments" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" />
<FIELD NAME="approvecomments" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
<FIELD NAME="accessconf" TYPE="char" LENGTH="40" NOTNULL="false"/>
<FIELD NAME="locked" TYPE="int" LENGTH="1" DEFAULT="0" NOTNULL="true" />
<FIELD NAME="urlid" TYPE="char" LENGTH="100" NOTNULL="false" />
<FIELD NAME="anonymise" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
......
......@@ -4501,7 +4501,7 @@ function xmldb_core_upgrade($oldversion=0) {
}
if ($oldversion < 2016062900) {
log_debug('Assign an institution for each existing group that doesn\'t have one.');
log_debug('Assign an istitution for each existing group that doesn\'t have one.');
$groups = execute_sql("UPDATE {group} SET institution = 'mahara'
WHERE (institution IS NULL OR institution = '') AND deleted = 0", array());
}
......@@ -4636,7 +4636,15 @@ function xmldb_core_upgrade($oldversion=0) {
add_key($table, $key);
}
}
}
if ($oldversion < 2016072500) {
log_debug('Drop obsolete column "accessconf" from "view" table');
$table = new XMLDBTable('view');
$field = new XMLDBField('accessconf');
if (field_exists($table, $field)) {
drop_field($table, $field);
}
}
return $status;
......
......@@ -16,7 +16,7 @@ $config = new stdClass();
// See https://wiki.mahara.org/wiki/Developer_Area/Version_Numbering_Policy
// For upgrades on stable branches, increment the version by one. On master, use the date.
$config->version = 2016072200;
$config->version = 2016072500;
$config->series = '16.10';
$config->release = '16.10dev';
$config->minupgradefrom = 2012080604;
......
......@@ -58,7 +58,6 @@ class View {
private $allowcomments;
private $approvecomments;
private $collection;
private $accessconf;
private $locked;
private $urlid;
private $skin;
......@@ -1008,7 +1007,6 @@ class View {
// Hash the config object so later on we can easily find
// all the views with the same config/access rights
$config['accesslist'] = $fullaccesslist;
$accessconf = substr(md5(serialize($config)), 0, 10);
foreach ($viewids as $viewid) {
$v = new View((int) $viewid);
......@@ -1024,7 +1022,6 @@ class View {
if (isset($config['copynewgroups'])) {
$v->set('copynewgroups', $config['copynewgroups']);
}
$v->set('accessconf', $accessconf);
$v->commit();
}
......@@ -6013,18 +6010,18 @@ class View {
* @param mixed $owner integer userid or array of userids
* @param mixed $group integer groupid or array of groupids
* @param mixed $institution string institution name or array of institution names
* @param string $matchconfig record all matches with given config hash (see set_access)
* @param null $obsoleteparam Former "$matchconfig" parameter, value now ignored, param kept only to avoid breaking back-compatibility.
* @param boolean $includeprofile include profile view
* @param integer $submittedgroup return only views & collections submitted to this group
* @param $string $sort Order to sort by (defaults to 'c.name, v.title')
*
* @return array, array
*/
function get_views_and_collections($owner=null, $group=null, $institution=null, $matchconfig=null, $includeprofile=true, $submittedgroup=null, $sort=null) {
function get_views_and_collections($owner=null, $group=null, $institution=null, $obsoleteparam=null, $includeprofile=true, $submittedgroup=null, $sort=null) {
$excludelocked = $group && group_user_access($group) != 'admin';
$sql = "
SELECT v.id, v.type, v.title, v.accessconf, v.ownerformat, v.startdate, v.stopdate, v.template,
SELECT v.id, v.type, v.title, v.ownerformat, v.startdate, v.stopdate, v.template,
v.owner, v.group, v.institution, v.urlid, v.submittedgroup, v.submittedhost, " .
db_format_tsfield('v.submittedtime', 'submittedtime') . ", v.submittedstatus,
c.id AS cid, c.name AS cname,
......@@ -6113,17 +6110,11 @@ class View {
$collections[$cid]['ownername'] = $v['ownername'];
$collections[$cid]['ownerurl'] = $v['ownerurl'];
}
if ($matchconfig && $matchconfig == $r['accessconf']) {
$collections[$cid]['match'] = true;
}
}
$collections[$cid]['views'][$vid] = $v;
}
else {
$views[$vid] = $v;
if ($matchconfig && $matchconfig == $r['accessconf']) {
$views[$vid]['match'] = true;
}
}
}
......@@ -6157,7 +6148,7 @@ class View {
/**
* Get all views & collections for a (user,group), grouped
* by their accesslists as defined by the accessconf column
* by their accesslists
*
* @param integer $owner
* @param integer $group
......
......@@ -150,7 +150,7 @@ These list must take into account the sort option choosen in the block config (B
# Change the sort options in the "Group pages" block
Given I log in as "userA" with password "Kupuhipa1"
And I should see "Group Z"
And I follow "Group Z"
And I follow "Group Z (Administrator)"
And I should see "Page userB_01"
And I follow "Pages" in the "ul.nav-inpage" "css_element"
And I click on "Edit \"Group homepage\""
......
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