Commit 75205f36 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1558246: Reset default group page shared settings"

parents ba6db6a4 c4416368
...@@ -50,5 +50,26 @@ function xmldb_blocktype_groupviews_upgrade($oldversion=0) { ...@@ -50,5 +50,26 @@ function xmldb_blocktype_groupviews_upgrade($oldversion=0) {
} }
} }
if ($oldversion < 2016032300) {
// Get the group view block from the default group home page view.
$sql = "SELECT bi.id, bi.configdata
FROM {block_instance} bi
INNER JOIN {view} v ON v.id = bi.view
WHERE bi.blocktype = 'groupviews'
AND v.type = 'grouphomepage'
AND v.owner = 0";
$defaultgrouppage = get_record_sql($sql, array());
if ($defaultgrouppage) {
log_debug("Processing default 'Group page' block to set the right shared pages/collections configurations");
$configdata = unserialize($defaultgrouppage->configdata);
$configdata['showsharedviews'] = 1;
$configdata['showsharedcollections'] = 1;
set_field('block_instance', 'configdata', serialize($configdata), 'id', $defaultgrouppage->id);
}
}
return true; return true;
} }
...@@ -13,5 +13,5 @@ ...@@ -13,5 +13,5 @@
defined('INTERNAL') || die(); defined('INTERNAL') || die();
$config = new StdClass; $config = new StdClass;
$config->version = 2015090300; $config->version = 2016032300;
$config->release = '1.0.2'; $config->release = '1.0.3';
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