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 6cc4b72 commit c3cf690
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions portfolio/boxnet/db/upgrade.php
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 < 2012112901) {
// 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 c3cf690

Please sign in to comment.