Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-42389

Restore: Broken activity backup causes notice before (correctly) throwing exception

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6
    • Fix Version/s: 2.6
    • Component/s: Backup
    • Labels:
      None
    • Testing Instructions:
      Hide

      0. If necessary, set debugging to 'DEVELOPER' level so debug messages are shown.

      1. Restore attached file broken-backup-2.mbz to a new course using default settings.

      EXPECTED: The restore should fail, throwing an exception 'error/unknown_context_mapping', but a 'Notice' should NOT appear above this exception.

      2. Restore attached file working-backup.mbz (this is the same backup before I purposefully broke it by editing the xml) to a new course using default settings.

      EXPECTED: Restore should complete successfully.

      Show
      0. If necessary, set debugging to 'DEVELOPER' level so debug messages are shown. 1. Restore attached file broken-backup-2.mbz to a new course using default settings. EXPECTED: The restore should fail, throwing an exception 'error/unknown_context_mapping', but a 'Notice' should NOT appear above this exception. 2. Restore attached file working-backup.mbz (this is the same backup before I purposefully broke it by editing the xml) to a new course using default settings. EXPECTED: Restore should complete successfully.
    • Affected Branches:
      MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Pull Master Branch:
      MDL-42389-master

      Description

      This is a bit obscure but can happen if activity code is broken.

      Basically there is a code path that throws an exception if a context id can't be mapped, which is correct, but because of the way it's coded, it will actually also display a notice if that happens.

      I don't think this can normally happen unless an activity backup is incorrect, however since I've encountered this (with an OU activity module), might as well fix the code.

      It is a very minor issue so suggest fix in master only.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                18/Nov/13