Moodle

1.7 Upgrade: undo_groupings() causes warnings (before groupings exist)

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.8.2
  • Fix Version/s: 1.8.3
  • Component/s: Groups
  • Labels:
    None
  • Database:
    MySQL
  • Affected Branches:
    MOODLE_18_STABLE
  • Fixed Branches:
    MOODLE_18_STABLE

Description

On a 1.7 upgrade:

1146: Table 'moodletest.groups_courses_groupings' doesn't exist

ADOConnection._Execute(
SELECT gpgs.courseid, ggs.groupid
FROM groups_courses_groupings gpgs,
..., false) % line 889, file: adodb.inc.php
ADOConnection.Execute(
SELECT gpgs.courseid, ggs.groupid
FROM groups_courses_groupings gpgs,
...) % line 674, file: dmllib.php
get_recordset_sql(
SELECT gpgs.courseid, ggs.groupid
FROM groups_courses_groupings gpgs,
...) % line 58, file: upgrade.php
undo_groupings() % line 679, file: upgrade.php
xmldb_main_upgrade(2006101010) % line 322, file: index.php

I assume this is again related to the various other bugs because of groups being seperated from the core upgrade

Issue Links

Activity

Hide
Dan Poltawski added a comment -

I guss something like this would do it..

— /home/dan/tmp/cvs/moodle/lib/db/upgrade.php 2007-07-12 13:53:21.000000000 +0100
+++ 18/lib/db/upgrade.php 2007-07-12 15:10:09.000000000 +0100
@@ -672,7 +672,7 @@
}

if ($result && $oldversion < 2007021504) {

  • if (empty($CFG->enablegroupings)) {
    + if ( table_exists(new XMLDBTable('groups_courses_groupings')) && empty($CFG->enablegroupings)) {
    // delete all groupings - they do not work yet
    // while keeping all existing groups
    require_once("$CFG->dirroot/group/db/upgrade.php");
Show
Dan Poltawski added a comment - I guss something like this would do it.. — /home/dan/tmp/cvs/moodle/lib/db/upgrade.php 2007-07-12 13:53:21.000000000 +0100 +++ 18/lib/db/upgrade.php 2007-07-12 15:10:09.000000000 +0100 @@ -672,7 +672,7 @@ } if ($result && $oldversion < 2007021504) {
  • if (empty($CFG->enablegroupings)) { + if ( table_exists(new XMLDBTable('groups_courses_groupings')) && empty($CFG->enablegroupings)) { // delete all groupings - they do not work yet // while keeping all existing groups require_once("$CFG->dirroot/group/db/upgrade.php");
Hide
Petr Škoda (skodak) added a comment -

should be fixed in cvs, I have added group version check instead - I hope it will be completely rewritten in 1.9

thanks for the report

Show
Petr Škoda (skodak) added a comment - should be fixed in cvs, I have added group version check instead - I hope it will be completely rewritten in 1.9 thanks for the report
Hide
Dan Poltawski added a comment -

Verified, closing

Show
Dan Poltawski added a comment - Verified, closing

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: