Moodle
  1. Moodle
  2. MDL-10332

Data module not filtering list by group on [Open Uni]-PILOT_1 [course]

    Details

    • Database:
      Any
    • Affected Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE
    • Rank:
      28875

      Description

      Opened: 2007-06-28 10:23 - (OU Bug 3396)

      Lisa reported this on Monday 25/6, on Starling. I've discovered that this is
      caused by a restore bug (mod/data/restorelib.php) where the 'groupid' column in
      mdl_data_records is either set to 0 or the pre-backed up groupid.


      I'm attaching a patch for 2 files,

      • There is a fix for data_records_restore_mods function in mod/data/restorelib.php, which is hopefully uncontroversial.
      • The 2nd file is an admin script to fix the group ID column in 'mdl_data_records' table, at present relying on a grouping ID (which is no use for core at present ). We need a different approach, but this hopefully shows what's involved.

        Activity

        Hide
        Nick Freear added a comment -

        Eloy, I wanted to see who maintains/ is default assignee for the database module - feel free to reassign to me if you're happy to accept the first part of the patch above.
        Thanks, Nick.

        Show
        Nick Freear added a comment - Eloy, I wanted to see who maintains/ is default assignee for the database module - feel free to reassign to me if you're happy to accept the first part of the patch above. Thanks, Nick.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Hi Nick.

        100% agree about the mod/data/restorelib.php patch. I would implement it from HEAD backporting it to any previous mod/data release (1.8...1.7....1.6). You/me ? As you prefer.

        About the admin stuff to fix incorrect groupid values, I'm adding Martin D here to allow him to decide what/how to implement it. I'm not really sure if an admin script is the best way of if we could, simply, execute it as part of the upgrade process.

        Also, I'm not sure about the current use of that groupingid field (there is one ongoing discussion about groups and their future) so I prefer Martin to comment about that (anything relaying on groupings right now sounds me as a warning).

        Ciao

        Show
        Eloy Lafuente (stronk7) added a comment - Hi Nick. 100% agree about the mod/data/restorelib.php patch. I would implement it from HEAD backporting it to any previous mod/data release (1.8...1.7....1.6). You/me ? As you prefer. About the admin stuff to fix incorrect groupid values, I'm adding Martin D here to allow him to decide what/how to implement it. I'm not really sure if an admin script is the best way of if we could, simply, execute it as part of the upgrade process. Also, I'm not sure about the current use of that groupingid field (there is one ongoing discussion about groups and their future) so I prefer Martin to comment about that (anything relaying on groupings right now sounds me as a warning). Ciao
        Hide
        Nick Freear added a comment -

        I've committed the fix to, mod/data/restorlib.php on HEAD, 1.8 and 1.7 branches, tagged MOODLE_*_MERGED. On the 1.7 branch I first checked that backup/restorelib.php did a backup_putid(..., "groups" ..) call in restore_create_groups function - it does!

        As you say, we probably need to wait for the group/grouping re-factor to pan out for a fix to the db - making progress on that!
        (Woops, missed Moodle 1.8.2 )
        Cheers, nick.

        Show
        Nick Freear added a comment - I've committed the fix to, mod/data/restorlib.php on HEAD, 1.8 and 1.7 branches, tagged MOODLE_*_MERGED. On the 1.7 branch I first checked that backup/restorelib.php did a backup_putid(..., "groups" ..) call in restore_create_groups function - it does! As you say, we probably need to wait for the group/grouping re-factor to pan out for a fix to the db - making progress on that! (Woops, missed Moodle 1.8.2 ) Cheers, nick.

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: