diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 287977431e6..8eb24e19e1b 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -6119,6 +6119,16 @@ FROM upgrade_main_savepoint(true, 2011033003.09); } + if ($oldversion < 2011033004.04) { + //preference not required since 2.0 + $DB->delete_records('user_preferences', array('name'=>'message_showmessagewindow')); + + //re-introducing emailstop. check that its turned off so people dont suddenly stop getting notifications + $DB->set_field('user', 'emailstop', 0); + + upgrade_main_savepoint(true, 2011033004.04); + } + return true; } @@ -6126,4 +6136,3 @@ FROM // 1/ drop block_pinned_old table here and in install.xml // 2/ drop block_instance_old table here and in install.xml -//TODO: AFTER 2.0 remove the column user->emailstop and the user preference "message_showmessagewindow" diff --git a/message/edit.php b/message/edit.php index a032dd9f4f3..06ddac76654 100644 --- a/message/edit.php +++ b/message/edit.php @@ -100,12 +100,7 @@ if (($form = data_submitted()) && confirm_sesskey()) { //only update the user's "emailstop" if its actually changed if ( $user->emailstop != $disableall ) { $user->emailstop = $disableall; - //create a new user object just in case any other changes have been - //made to the user object that we don't want to save - $usertoupdate = new stdClass(); - $usertoupdate->id = $user->id; - $usertoupdate->emailstop = $user->emailstop; - $DB->update_record('user', $usertoupdate); + $DB->set_field('user', 'emailstop', $user->emailstop, array("id"=>$user->id)); } $preferences = array(); diff --git a/version.php b/version.php index 8d2673ab9a5..42a86464765 100644 --- a/version.php +++ b/version.php @@ -30,7 +30,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2011033004.03; // 20110330 = branching date YYYYMMDD - do not modify! +$version = 2011033004.04; // 20110330 = branching date YYYYMMDD - do not modify! // RR = release version - do not change in weeklies // .XX = incremental changes