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

Course creation without category

    XMLWordPrintable

Details

    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_400_STABLE
    • MOODLE_310_STABLE, MOODLE_311_STABLE
    • MDL-72309-311
    • Hide

      Permissions preparations

      We need all users to be able to perform course requests (for ease of testing)

      1. Go to http://your.site/admin/roles/manage.php
      2. Then select the “Authenticated user” role
      3. Edit button
      4. Allow the moodle/course:request to the role, save.

      Create/edit course

      1. Edit course
      2. Confirm Course category is a required field
      3. Clear the Course category field
      4. Try to submit the form
      5. Confirm you see validation error "You must supply a value here." for the Course category field
      6. Select a course category and submit form
      7. Confirm course is created in that category

      Requesting course creation

      1. Login as non-admin
      2. Navigate to <WWWROOT>/course/index.php
      3. Press Request a course
      4. Fill in course full name/short name fields
      5. Confirm Course category is a required field
      6. Clear the Course category field
      7. Try to submit the form
      8. Confirm you see validation error "You must supply a value here." for the Course category field
      9. Select a course category and submit form
      10. Confirm course request is created

      Upload courses

      1. Navigate to Courses > Upload courses in site administration
      2. Upload 72309.csv and press Preview
      3. Confirm Course category is a required field
      4. Clear the Course category field
      5. Try to submit the form
      6. Confirm you see validation error "You must supply a value here." for the Course category field
      7. Select a course category and submit form
      8. Confirm course is uploaded

      Add/edit course category ("Parent category" field)

      1. Navigate to Courses > Manage courses and categories in site administration
      2. Press Create new category
      3. Fill in name field
      4. Confirm Course category is a required field
      5. Clear the Course category field
      6. Try to submit the form
      7. Confirm you see validation error "You must supply a value here." for the Course category field
      8. Select a course category and submit form
      9. Confirm category is created

      Delete course category ("Move into" field)

      1. Add a course to the category you previously created
      2. Press Actions menu > Delete for the category
      3. Confirm Move into is a required field
      4. Clear the Move into field
      5. Try to submit the form
      6. Confirm you see validation error "You must supply a value here." for the Course category field
      7. Select a course category and submit form
      8. Confirm category is deleted, the course is moved into the selected category

      Add cohorts ("Context" field)

      1. Navigate to Users > Accounts > Cohorts in site administration
      2. Press Add new cohort
      3. Fill in Name field
      4. Confirm Context is a required field
      5. Clear the Context field
      6. Try to submit the form
      7. Confirm you see validation error "You must supply a value here." for the Context field
      8. Select a course category and submit form
      9. Confirm cohort is created

      Copy course

      1. Navigate to a course
      2. From the Actions menu, click Copy course
      3. Fill in course full name/short name fields
      4. Confirm Course category is a required field
      5. Clear the Course category field
      6. Try to submit the form
      7. Confirm you see validation error "You must supply a value here." for the Course category field
      8. Select a course category and submit form
      9. Confirm course copy request is created
      Show
      Permissions preparations We need all users to be able to perform course requests (for ease of testing) Go to http://your.site/admin/roles/manage.php Then select the “Authenticated user” role Edit button Allow the moodle/course:request to the role, save. Create/edit course Edit course Confirm Course category is a required field Clear the Course category field Try to submit the form Confirm you see validation error "You must supply a value here." for the Course category field Select a course category and submit form Confirm course is created in that category Requesting course creation Login as non-admin Navigate to <WWWROOT>/course/index.php Press Request a course Fill in course full name/short name fields Confirm Course category is a required field Clear the Course category field Try to submit the form Confirm you see validation error "You must supply a value here." for the Course category field Select a course category and submit form Confirm course request is created Upload courses Navigate to Courses > Upload courses in site administration Upload 72309.csv and press Preview Confirm Course category is a required field Clear the Course category field Try to submit the form Confirm you see validation error "You must supply a value here." for the Course category field Select a course category and submit form Confirm course is uploaded Add/edit course category ("Parent category" field) Navigate to Courses > Manage courses and categories in site administration Press Create new category Fill in name field Confirm Course category is a required field Clear the Course category field Try to submit the form Confirm you see validation error "You must supply a value here." for the Course category field Select a course category and submit form Confirm category is created Delete course category ("Move into" field) Add a course to the category you previously created Press Actions menu > Delete for the category Confirm Move into is a required field Clear the Move into field Try to submit the form Confirm you see validation error "You must supply a value here." for the Course category field Select a course category and submit form Confirm category is deleted, the course is moved into the selected category Add cohorts ("Context" field) Navigate to Users > Accounts > Cohorts in site administration Press Add new cohort Fill in Name field Confirm Context is a required field Clear the Context field Try to submit the form Confirm you see validation error "You must supply a value here." for the Context field Select a course category and submit form Confirm cohort is created Copy course Navigate to a course From the Actions menu, click Copy course Fill in course full name/short name fields Confirm Course category is a required field Clear the Course category field Try to submit the form Confirm you see validation error "You must supply a value here." for the Course category field Select a course category and submit form Confirm course copy request is created

    Description

      It is possible to remove the category label when creating a new course. When no category labels are present and you attempt to create the course an error is shown.

      Can't find data record in database table course_categories.

      Debug info: SELECT * FROM

      Unknown macro: {course_categories}

      WHERE id IS NULL
      [array (
      )]
      Error code: invalidrecord
      ×Stack trace:
      line 1646 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
      line 1622 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
      line 2329 of /course/lib.php: call to moodle_database->get_record()
      line 162 of /course/edit.php: call to create_course()
      ×Output buffer: <br /> <b>Notice</b>: Undefined property: stdClass::$category in <b>/opt/app/course/lib.php</b> on line <b>2329</b><br />

      Attachments

        1. 72309.csv
          0.0 kB
        2. MDL-72309_Add or edit category_1.png
          MDL-72309_Add or edit category_1.png
          84 kB
        3. MDL-72309_Add or edit category_2.png
          MDL-72309_Add or edit category_2.png
          87 kB
        4. MDL-72309_Add or edit category_3.png
          MDL-72309_Add or edit category_3.png
          124 kB
        5. MDL-72309_Cohort_1.png
          MDL-72309_Cohort_1.png
          82 kB
        6. MDL-72309_Cohort_2.png
          MDL-72309_Cohort_2.png
          83 kB
        7. MDL-72309_Cohort_3.png
          MDL-72309_Cohort_3.png
          68 kB
        8. MDL-72309_Copy course_3.png
          MDL-72309_Copy course_3.png
          57 kB
        9. MDL-72309_Course copy_1.png
          MDL-72309_Course copy_1.png
          125 kB
        10. MDL-72309_Course copy_2.png
          MDL-72309_Course copy_2.png
          127 kB
        11. MDL-72309_Create or edit course_1.png
          MDL-72309_Create or edit course_1.png
          115 kB
        12. MDL-72309_Create or edit course_2.png
          MDL-72309_Create or edit course_2.png
          117 kB
        13. MDL-72309_Create or edit course_3.png
          MDL-72309_Create or edit course_3.png
          118 kB
        14. MDL-72309_Delete category_1.png
          MDL-72309_Delete category_1.png
          91 kB
        15. MDL-72309_Delete category_2.png
          MDL-72309_Delete category_2.png
          93 kB
        16. MDL-72309_Delete category_3.png
          MDL-72309_Delete category_3.png
          130 kB
        17. MDL-72309_Request course_1.png
          MDL-72309_Request course_1.png
          81 kB
        18. MDL-72309_Request course_2.png
          MDL-72309_Request course_2.png
          79 kB
        19. MDL-72309_Request course_3.png
          MDL-72309_Request course_3.png
          46 kB
        20. MDL-72309_Upload courses_1.png
          MDL-72309_Upload courses_1.png
          106 kB
        21. MDL-72309_Upload courses_2.png
          MDL-72309_Upload courses_2.png
          108 kB
        22. MDL-72309_Upload courses_3.png
          MDL-72309_Upload courses_3.png
          67 kB
        23. photo_2021-08-10_21-55-28.jpg
          photo_2021-08-10_21-55-28.jpg
          9 kB

        Issue Links

          Activity

            People

              pholden Paul Holden
              sanderbangma Sander Bangma
              Carlos Escobedo Carlos Escobedo
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Angelia Dela Cruz Angelia Dela Cruz
              Amaia Anabitarte, Carlos Escobedo, Laurent David, Sabina Abellan, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                8/Nov/21

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 hours, 30 minutes
                  3h 30m