Commit 3d3d66f8 authored by Jean-Philippe Gaudreau's avatar Jean-Philippe Gaudreau Committed by Robert Lyon

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 f62f9619
<?php
/**
*
* @package mahara
* @subpackage blocktype-groupviews
* @author Catalyst IT Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
* @copyright For copyright information on Mahara, please see the README file distributed with this software.
*
*/
defined('INTERNAL') || die();
safe_require('blocktype', 'groupviews');
function xmldb_blocktype_groupviews_upgrade($oldversion=0) {
if ($oldversion < 2015020201) {
// 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 = 2015020200;
$config->release = '1.0.1';
$config->version = 2015020201;
$config->release = '1.0.2';
\ No newline at end of file
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