Skip to content

Commit

Permalink
MDL-42668 portfolio_boxnet: Disable the portfolio during upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Massart committed Nov 7, 2013
1 parent 7c6ad25 commit 337107f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions portfolio/boxnet/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,22 @@
*/
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();
}

Expand Down

0 comments on commit 337107f

Please sign in to comment.