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

Backup/restore "Include custom fields" setting is not observed

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.3.3
    • Backup, Course
    • MOODLE_403_STABLE
    • MDL-80929-403
    • MDL-80929-404
    • Hide

      Setup

      1. Log in as admin
      2. Navigation to Courses > Course custom fields in site administration
      3. Add a new category (if none exists)
      4. Add a new Checkbox custom field
        • Name: Course field
        • Shortname: coursefield
      5. Navigation to Groups > Group custom fields in site administration
      6. Add a new category (if none exists)
      7. Add a new Checkbox custom field
        • Name: Group field
        • Shortname: groupfield
      8. Navigation to Groups > Grouping custom fields in site administration
      9. Add a new category (if none exists)
      10. Add a new Checkbox custom field
        • Name: Grouping field
        • Shortname: groupingfield
      11. Create a course
        • Course field: 1 (checked)
      12. Navigate to Participants > Groups in course
      13. Create a group
        • Group field: 1 (checked)
      14. Navigate to Participants > Groupings in course
      15. Create a grouping
        • Grouping field: 1 (checked)

      Backup custom fields

      1. Navigate to More > Course reuse > Backup in course
      2. Ensure Include custom fields is unchecked
      3. Press Jump to final step
      4. Wait to cron to finish the backup
      5. Download the backup file
      6. Examine the following files inside the downloaded archive, confirm absence of custom field data:
        • ./course/course.xml
        • ./groups.xml
      7. Navigate back to More > Course reuse > Backup in course
      8. Ensure Include custom fields is checked
      9. Press Jump to final step
      10. Wait to cron to finish the backup
      11. Download the backup file
      12. Examine the following files inside the downloaded archive, confirm presence of custom field data:
        • ./course/course.xml
        • ./groups.xml

      Restore custom fields

      1. Navigate to Courses > Restore course in site administration
      2. Upload the previously created backup without custom fields
      3. Press Restore
      4. Choose the option to restore as a new course
      5. At the 3. Settings stage, confirm that Include custom fields is disabled
      6. Navigate through the rest of the wizard
      7. Confirm the course, group & grouping all restore correctly (you may need to wait for cron)
      1. Navigate to Courses > Restore course in site administration
      2. Upload the previously created backup with custom fields
      3. Press Restore
      4. Choose the option to restore as a new course
      5. At the 3. Settings stage, ensure Include custom fields is unchecked
      6. # Navigate through the rest of the wizard
      7. Confirm the course/group/grouping all restore correctly (you may need to wait for cron)
      8. Confirm that the custom field values were not imported (edit the course/group/grouping, each field should be unchecked)
      1. Navigate to Courses > Restore course in site administration
      2. Upload the previously created backup with custom fields
      3. Press Restore
      4. Choose the option to restore as a new course
      5. At the 3. Settings stage, ensure Include custom fields is checked
      6. Navigate through the rest of the wizard
      7. Confirm the course/group/grouping all restore correctly (you may need to wait for cron)
      8. Confirm that the custom field values were imported (edit the course/group/grouping, each field should be checked)
      Show
      Setup Log in as admin Navigation to Courses > Course custom fields in site administration Add a new category (if none exists) Add a new Checkbox custom field Name: Course field Shortname: coursefield Navigation to Groups > Group custom fields in site administration Add a new category (if none exists) Add a new Checkbox custom field Name: Group field Shortname: groupfield Navigation to Groups > Grouping custom fields in site administration Add a new category (if none exists) Add a new Checkbox custom field Name: Grouping field Shortname: groupingfield Create a course Course field: 1 (checked) Navigate to Participants > Groups in course Create a group Group field: 1 (checked) Navigate to Participants > Groupings in course Create a grouping Grouping field: 1 (checked) Backup custom fields Navigate to More > Course reuse > Backup in course Ensure Include custom fields is unchecked Press Jump to final step Wait to cron to finish the backup Download the backup file Examine the following files inside the downloaded archive, confirm absence of custom field data: ./course/course.xml ./groups.xml Navigate back to More > Course reuse > Backup in course Ensure Include custom fields is checked Press Jump to final step Wait to cron to finish the backup Download the backup file Examine the following files inside the downloaded archive, confirm presence of custom field data: ./course/course.xml ./groups.xml Restore custom fields Navigate to Courses > Restore course in site administration Upload the previously created backup without custom fields Press Restore Choose the option to restore as a new course At the 3. Settings stage, confirm that Include custom fields is disabled Navigate through the rest of the wizard Confirm the course, group & grouping all restore correctly (you may need to wait for cron) Navigate to Courses > Restore course in site administration Upload the previously created backup with custom fields Press Restore Choose the option to restore as a new course At the 3. Settings stage, ensure Include custom fields is unchecked # Navigate through the rest of the wizard Confirm the course/group/grouping all restore correctly (you may need to wait for cron) Confirm that the custom field values were not imported (edit the course/group/grouping, each field should be unchecked) Navigate to Courses > Restore course in site administration Upload the previously created backup with custom fields Press Restore Choose the option to restore as a new course At the 3. Settings stage, ensure Include custom fields is checked Navigate through the rest of the wizard Confirm the course/group/grouping all restore correctly (you may need to wait for cron) Confirm that the custom field values were imported (edit the course/group/grouping, each field should be checked)

      When a course has a custom field with a value,   if a backup of the course is made without including the "custom fields" ,  and then you restore the backup in a new Course, checking again that "custom fields" are unchecked for restore,  the custom fields are still present in the new Course.

       

      The problem was found in Moodle 4.1.1+

      but also It´s found in Moodle 4.3.3 (Build: 20240212) (2023100903)  at https://school.moodledemo.net

      There are more users that found the same bug: https://moodle.org/mod/forum/discuss.php?d=424441

       

      Steps to reproduce (check the video attached):

      • Go to https://school.moodledemo.net and login with manager account
      • From the administration, find a course with at least one custom field with a value.
      • Make a backup of the Course WITHOUT the customfields
      • then restore the backup in a brand new Course without the customfields
      • Check that the customfields are anyway restored

            pholden Paul Holden
            hector.pasarin Hector Pasarin
            Stevani Andolo Stevani Andolo
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 32 minutes
                1h 32m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.