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

course copy prints error 'copy_class_field_not_found'

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Critical Critical
    • None
    • 3.9.1, 3.10, 4.0
    • Backup, Course
    • MOODLE_310_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
    • MDL-69508-master
    • Hide

      Steps to test

      1. Go to edit the role "Manager" and unset the permissions "moodle/backup:userinfo" and "moodle/restore:userinfo".
      2. Assign a user to this role in a course category context.
      3. Login as the manager.
      4. Go into a course inside the category where this user is assigned as manager.
      5. Choose from the course menu the item "Copy course".
      6. Notice: there is no checkbox to include userdata!
      7. Fill out all form elements and click on the button "Copy and view"
      8. The page is redirected to the page "Course copy progress" which shows the current created copy job.
      9. After the next cron run the job the copy process is done and the job show a tick in the column "Status"
      10. In the column "Destination" the new created course is listed as hyperlink.
      Show
      Steps to test Go to edit the role "Manager" and unset the permissions "moodle/backup:userinfo" and "moodle/restore:userinfo". Assign a user to this role in a course category context. Login as the manager. Go into a course inside the category where this user is assigned as manager. Choose from the course menu the item "Copy course". Notice: there is no checkbox to include userdata! Fill out all form elements and click on the button "Copy and view" The page is redirected to the page "Course copy progress" which shows the current created copy job. After the next cron run the job the copy process is done and the job show a tick in the column "Status" In the column "Destination" the new created course is listed as hyperlink.

      If you don't have the permissions to backup userdata the course copy ui prints an error.

      Steps to reproduce

      1. Go to edit the role "Manager" and unset the permissions "moodle/backup:userinfo" and "moodle/restore:userinfo".
      2. Assign a user to this role in a course category context.
      3. Login as the manager.
      4. Go into a course inside the category where this user is assigned as manager.
      5. Choose from the course menu the item "Copy course".
      6. Notice: there is no checkbox to include userdata!
      7. Fill out all form elements and click on the button "Copy and view"
      8. You get an error message "error/copy_class_field_not_found".

      The reason for this error is the missing value "userdata" which is not defined in the moodleform if the capability are not sufficiant.

      If you add a hidden field in this case the error message is not showing up anymore but now the adhoc task stucks with the error "error/setting_locked_by_permission".

      This happens because the asynchronous_copy_task tries to set the value "0" to the backup_setting "user" which is not allowed.

      If you change the code in the asynchronous_copy_task in the way that the value "1" is set if $copyinfo->userdata is true, then the copy task runs to the end.

            Unassigned Unassigned
            grabs Andreas Grabs
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 16 minutes
                16m

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