Skip to content

Commit

Permalink
MDL-13766, fix alfresco version number
Browse files Browse the repository at this point in the history
  • Loading branch information
Dongsheng Cai committed May 7, 2010
1 parent 900d460 commit c4c3b90
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
22 changes: 15 additions & 7 deletions lib/db/upgrade.php
Expand Up @@ -2986,7 +2986,7 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint($result, 2010031900);
}


if ($result && $oldversion < 2010032400) {
// Upgrade all of those using the standardold theme to the use the standard
// theme instead
Expand Down Expand Up @@ -3699,7 +3699,7 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint($result, 2010042802);
}


if ($result && $oldversion < 2010043000) { // Adding new course completion feature

/// Add course completion tables
Expand Down Expand Up @@ -3967,14 +3967,14 @@ function xmldb_main_upgrade($oldversion) {
if (!$DB->record_exists('my_pages', array('userid'=>NULL, 'private'=>1))) {
$result = $result && $DB->insert_record('my_pages', $mypage);
}

/// This bit is a "illegal" hack, unfortunately, but there is not a better way to install default
/// blocks right now, since the upgrade function need to be called after core AND plugins upgrade,
/// blocks right now, since the upgrade function need to be called after core AND plugins upgrade,
/// and there is no such hook yet. Sigh.

if ($mypage = $DB->get_record('my_pages', array('userid'=>NULL, 'private'=>1))) {
if (!$DB->record_exists('block_instances', array('pagetypepattern'=>'my-index', 'parentcontextid'=>SITEID, 'subpagepattern'=>$mypage->id))) {
if (!$DB->record_exists('block_instances', array('pagetypepattern'=>'my-index', 'parentcontextid'=>SITEID, 'subpagepattern'=>$mypage->id))) {

// No default exist there yet, let's put a few into My Moodle so it's useful.

$blockinstance = new stdClass;
Expand Down Expand Up @@ -4007,7 +4007,15 @@ function xmldb_main_upgrade($oldversion) {
/// Main savepoint reached
upgrade_main_savepoint($result, 2010050403);
}

// fix repository_alfresco version number
if ($result && $oldversion < 2010050411) {
// force to change repository_alfresco version number to upgrade smoothly (from preview 1 -> preview 2)
if ($repository_plugin = $DB->get_record('config_plugins', array('plugin'=>'repository_alfresco', 'name'=>'version'))) {
$repository_plugin->value = '2008000000';
$DB->update_record('config_plugins', $repository_plugin);
}
upgrade_main_savepoint($result, 2010050411);
}

return $result;
}
Expand Down
2 changes: 1 addition & 1 deletion repository/alfresco/version.php
Expand Up @@ -15,4 +15,4 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$plugin->version = 2009080102;
$plugin->version = 2010050700;
2 changes: 1 addition & 1 deletion version.php
Expand Up @@ -6,7 +6,7 @@
// This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php)

$version = 2010050404; // YYYYMMDD = date of the last version bump
$version = 2010050411; // YYYYMMDD = date of the last version bump
// XX = daily increments

$release = '2.0 Preview 1 (Build: 20100507)'; // Human-friendly version name
Expand Down

0 comments on commit c4c3b90

Please sign in to comment.