Commit c4416368 authored by Jean-Philippe Gaudreau's avatar Jean-Philippe Gaudreau Committed by Kristina Hoeppner
Browse files

Bug 1558246: Reset default group page shared settings

We need to reset 'showsharedviews' and 'showsharedcollections' values
to 'By members of this group' for the default group home page because
they were wrongly modified.

behatnotneeded

Change-Id: I01b9eeb12af5db2c2a639bbaea24cd1f6b44b93e
parent ed4a7bd3
......@@ -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;
}
......@@ -13,5 +13,5 @@
defined('INTERNAL') || die();
$config = new StdClass;
$config->version = 2015090300;
$config->release = '1.0.2';
$config->version = 2016032300;
$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