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

Badges with criteria that depend on other badges are not restored correctly when backed up

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 3.6.3
    • Fix Version/s: None
    • Component/s: Backup, Badges
    • Labels:
      None
    • Affected Branches:
      MOODLE_36_STABLE

      Description

      To reproduce:

      1. Create a course with any type of badge (activity completion for example) and enable it.
      2. Create another badge with the criteria that you are awarded the first badge, this badge can be enabled or left disabled
      3. Back up the course with user data and badges selected
      4. Restore the course as a new course
      5. Check the restored course's badges. 

      Expected result: The new 2nd badge is created with criteria that it is awarded when you are awarded the new 1st badge.

      Actual result: The 2nd badge says under criteria "Complete: Badge with id {$a} does not exist."

      It appears when the course is restored the record created in the badge_criteria_param table is bad, it has a critid (and a proper record in the corresponding badge_criteria table)  but the name column is an empty string and the value column is null.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: