Commit d22dd1f0 authored by Nigel McNie's avatar Nigel McNie
Browse files

Make sure the system profile view is marked as a template and can be

copied by everyone.
parent 7c39d0f6
......@@ -1479,6 +1479,16 @@ function xmldb_core_upgrade($oldversion=0) {
execute_sql("UPDATE {auth_instance} SET instancename = 'Internal' WHERE institution = 'mahara' AND authname = 'internal' AND instancename = 'internal'");
}
if ($oldversion < 2008121500) {
// Make sure the system profile view is marked as a template and is
// allowed to be copied by everyone
execute_sql("UPDATE {view} SET template = 1 WHERE id = (SELECT id FROM {view} WHERE owner = 0 AND type = 'profile')");
$view = new View(get_field('view', 'id', 'owner', 0, 'type', 'profile'));
$view->set_access(array(array(
'type' => 'loggedin'
)));
}
return $status;
}
......
......@@ -1298,15 +1298,18 @@ function install_system_profile_view() {
}
require_once(get_config('libroot') . 'view.php');
require_once(get_config('docroot') . 'blocktype/lib.php');
$view = new View(0, array(
$view = View::create(array(
'type' => 'profile',
'owner' => 0,
'numcolumns' => 2,
'ownerformat' => FORMAT_NAME_PREFERREDNAME,
'title' => get_string('profileviewtitle', 'view'),
'description' => '',
'template' => 1,
));
$view->commit();
$view->set_access(array(array(
'type' => 'loggedin'
)));
$blocktypes = array('myviews' => 1, 'mygroups' => 1, 'myfriends' => 2, 'wall' => 2); // column ids
$installed = get_column_sql('SELECT name FROM {blocktype_installed} WHERE name IN (' . join(',', array_map('db_quote', array_keys($blocktypes))) . ')');
$weights = array(1 => 0, 2 => 0);
......
......@@ -27,7 +27,7 @@
defined('INTERNAL') || die();
$config = new StdClass;
$config->version = 2008111201;
$config->version = 2008121500;
$config->release = '1.1.0beta3dev';
$config->minupgradefrom = 2007080700;
$config->minupgraderelease = '0.8.0 (release tag 0.8.0_RELEASE)';
......
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