Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-13847 backup/restore issues meta
  3. MDL-8189

Modules not implementing xxx_backup_one_mod() doesn't backup at all

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.6, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.7, 1.7.1, 1.7.2, 1.8
    • Fix Version/s: None
    • Component/s: Backup
    • Labels:
      None
    • Environment:
      Moodle 1.6
    • Affected Branches:
      MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE

      Description

      I was playing with one old module (certificate) that works perfectly under Moodle 1.6. Then, I've tried to perform one backup from one course containing one certificate.

      I was surprised when no certificate was available to restore. Looking at code it seems that the "individual selection of activities" developed for 1.6 supported to "fall back" to all activities if the module didn't implemented the xxx_backup_one_mod() function (these was discussed in order to allow 3rd part modules to continue working without problems).

      After looking to code, I've found that, in backuplib.php in the backup_fetch_prefs_from_request() function, the line 1987 (16_STABLE):

      if (!count_records('course_modules','course',$course->id,'module',$mod->id) || !function_exists($modbackupone))

      prevents activities without the "one" function to be registered for backup.

      The question is what to do:

      1) Try to fix that, in order to allow old modules not implementing the "one" function to work (from 1.6 to 1.8). I imagine this will affect backup in other steps and perhaps restore too.
      2) Ignore it, assuming that only modules implementing the "one" function will work (current approach). This will allow us to delete a bunch of code that is currently in backuplib and modules in order to support "old" backup.

      Just to think a bit about it... it's important but it seems that it hasn't caused too much problems in the past...

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            stronk7 Eloy Lafuente (stronk7)
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: