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

Course copy: idnumber field is missing if not permitted

    XMLWordPrintable

Details

    • MOODLE_310_STABLE, MOODLE_39_STABLE
    • MOODLE_39_STABLE
    • MDL-69156_master
    • Easy
    • Hide

      Setup

      1. Log in as an admin
      2. Navigate to Site admin -> Users -> Define roles
      3. Click on the "Manager" role
      4. Click "Reset", and press "Save" on the next page to reset all capabilities for the Manage role
      5. Navigate to Site admin -> Users -> Assign roles
      6. Assign one user to the "Manager" role (not your admin)
      7. Create a course which has an idnumber set

      Standard (regression) test

      1. Log in as the manager that you just assigned
      2. Navigate to the course you created
      3. From the course settings menu (cog in Boost), choose "Copy course"
        1. Confirm that the "Course ID number" is filled with the current ID number
      4. Enter a new full and short name for the course
      5. Click "Copy and view"
        1. Confirm that an error that the ID number is already in use was shown
      6. Change the Course ID Number to something unique
      7. Click "Copy and view"
        1. Confirm that the course was copy was started
      8. Run cron:

        php admin/cli/cron.php
        

      9. Wait for the course to be copied
      10. View the new course and edit its settings
        1. Confirm that the correct new name, shortname, and idnumber were shown

      Fixed functionality test

      1. Log in as admin
      2. Navigate to Site admin -> Users -> Define roles
      3. Choose the edit icon on the "Manager" role
      4. Search for the "moodle/course:changeidnumber" capability and untick it
      5. Save changes
      6. Log in as the manager user again
      7. Navigate to the course you created during setup
      8. From the course settings menu (cog in Boost), choose "Copy course"
        1. Confirm that an error that the ID number is shown, but empty and not editable
      9. Enter a new full and short name for the course
      10. Click "Copy and view"
        1. Confirm that the course was copy was started
      11. Run cron:

        php admin/cli/cron.php
        

      12. Wait for the course to be copied
      13. View the new course and edit its settings
        1. Confirm that the correct new name, shortname are shown
        2. Confirm that the idnumber field is empty
      Show
      Setup Log in as an admin Navigate to Site admin -> Users -> Define roles Click on the "Manager" role Click "Reset", and press "Save" on the next page to reset all capabilities for the Manage role Navigate to Site admin -> Users -> Assign roles Assign one user to the "Manager" role (not your admin) Create a course which has an idnumber set Standard (regression) test Log in as the manager that you just assigned Navigate to the course you created From the course settings menu (cog in Boost), choose "Copy course" Confirm that the "Course ID number" is filled with the current ID number Enter a new full and short name for the course Click "Copy and view" Confirm that an error that the ID number is already in use was shown Change the Course ID Number to something unique Click "Copy and view" Confirm that the course was copy was started Run cron: php admin/cli/cron.php Wait for the course to be copied View the new course and edit its settings Confirm that the correct new name, shortname, and idnumber were shown Fixed functionality test Log in as admin Navigate to Site admin -> Users -> Define roles Choose the edit icon on the "Manager" role Search for the " moodle/course:changeidnumber " capability and untick it Save changes Log in as the manager user again Navigate to the course you created during setup From the course settings menu (cog in Boost), choose "Copy course" Confirm that an error that the ID number is shown, but empty and not editable Enter a new full and short name for the course Click "Copy and view" Confirm that the course was copy was started Run cron: php admin/cli/cron.php Wait for the course to be copied View the new course and edit its settings Confirm that the correct new name, shortname are shown Confirm that the idnumber field is empty

    Description

      Actual result

      1. Log in to your Moodle site as not admin user.
      2. The logged in user should not have the capability moodle/course:changeidnumber.
      3. Go to a course.
      4. Select 'Copy course' from the Actions menu.
      5. Enter a course full name and short name then click the button 'Copy and view'.
      6. Now should be thrown a error/copy_class_field_not_found exception.

      Expected result

      1. Log in to your Moodle site as not admin user.
      2. The logged in user should not have the capability moodle/course:changeidnumber.
      3. Go to a course.
      4. Select 'Copy course' from the Actions menu.
      5. Enter a course full name and short name then click the button 'Copy and view'.
      6. Verify that course being copied is listed as source course and that the current operation goes from backup to restore to complete. (This will take a few minutes.)
      7. Verify that you receive a message that the backup and restore is complete.
      8. Click the link for the course copy and verify that a correct copy has been made.

      Attachments

        Issue Links

          Activity

            People

              pead Adrian Perez
              pead Adrian Perez
              Luca Bösch Luca Bösch
              Andrew Lyons Andrew Lyons
              Janelle Barcega Janelle Barcega
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                9/Nov/20

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours
                  2h