mirror of
https://github.com/moodle/moodle.git
synced 2025-04-16 22:15:24 +02:00
MDL-42668 portfolio_boxnet: Disable the portfolio during upgrade
This commit is contained in:
parent
7c6ad254f3
commit
337107fe4b
@ -32,14 +32,22 @@ defined('MOODLE_INTERNAL') || die();
|
||||
*/
|
||||
function xmldb_portfolio_boxnet_upgrade($oldversion) {
|
||||
global $CFG, $DB;
|
||||
require_once($CFG->dirroot . '/portfolio/boxnet/db/upgradelib.php');
|
||||
|
||||
$dbman = $DB->get_manager();
|
||||
|
||||
if ($oldversion < 2013110600) {
|
||||
// Message the admins.
|
||||
require_once($CFG->libdir . '/portfoliolib.php');
|
||||
require_once($CFG->dirroot . '/portfolio/boxnet/db/upgradelib.php');
|
||||
|
||||
$existing = $DB->get_record('portfolio_instance', array('plugin' => 'boxnet'), '*', IGNORE_MULTIPLE);
|
||||
if ($existing) {
|
||||
|
||||
// Disable Box.net.
|
||||
$instance = portfolio_instance($existing->id, $existing);
|
||||
$instance->set('visible', 0);
|
||||
$instance->save();
|
||||
|
||||
// Message the admins.
|
||||
portfolio_boxnet_admin_upgrade_notification();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user