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

Custom field values in course overview block follow incorrect order

    XMLWordPrintable

Details

    • MOODLE_310_STABLE, MOODLE_39_STABLE
    • MOODLE_310_STABLE, MOODLE_39_STABLE
    • MDL-69526-311
    • MDL-69526-master
    • Hide

      Setup

      1. Login as an admin
      2. Navigate to "Site administration -> Courses > Course custom fields"
      3. Click on "Add a new category"
      4. Click on "Add a new custom field" and select in the dropdown the "Dropdown menu" option
      5. Fill out the "Name" as "Semester" (General)
      6. Fill out the "Short name as "semester" (General)
      7. Fill out the "Menu options" (Dropdown menu field settings) as following:
        Autumn term 2011/12
        Spring term 2012
        Autumn term 2012/13
        Spring term 2013
        Autumn term 2013/14
        Spring term 2014
        Autumn term 2014/15
        Spring term 2015
        Autumn term 2015/16
        Spring term 2016
        Autumn term 2016/17
        Spring term 2017
        Autumn term 2017/18
        Spring term 2018
        Autumn term 2018/19
        Spring term 2019
        Autumn term 2019/20
        Spring term 2020
        Autumn term 2020/21
        Spring term 2021
      8. Click on "Save changes".
      9. Navigate to "Site administration >Plugins > Blocks > Course overview"
      10. Allow under the "Available filters" the "Custom field" (displaygroupingcustomfield) and selectin the "Field to use" (customfiltergrouping) the "Semester".
      11. Click on "Save changes".
      12. Navigate to "Site administration >Courses > Add a new course"
      13. Create several courses and enrol a user to this course (repeating step 12):
        • with "Semester" set to "Spring term 2020"
        • with "Semester" set to "Autumn term 2019/20"
        • with "Semester" set to "Spring term 2012"

      Standard (regression) test

      1. Login as the enrolled user
      2. Navigate to the "Dashboard"
      3. Navigate to the "Course overview" block or add one if the block is not present
      4. Click on the filter of the "Categories"
      5. Verify the "Autumn term 2019/20" option is first and "No semester" is last

      Fixed functionality test

      • Login as the enrolled user
      • Navigate to the "Dashboard"
      • Navigate to the "Course overview" block or add one if the block is not present
      • Click on the filter of the "Categories"
      • Verify the "Spring term 2012" option is first and "No semester" is last
      Show
      Setup Login as an admin Navigate to "Site administration -> Courses > Course custom fields" Click on "Add a new category" Click on "Add a new custom field" and select in the dropdown the "Dropdown menu" option Fill out the "Name" as "Semester" (General) Fill out the "Short name as "semester" (General) Fill out the "Menu options" (Dropdown menu field settings) as following: Autumn term 2011/12 Spring term 2012 Autumn term 2012/13 Spring term 2013 Autumn term 2013/14 Spring term 2014 Autumn term 2014/15 Spring term 2015 Autumn term 2015/16 Spring term 2016 Autumn term 2016/17 Spring term 2017 Autumn term 2017/18 Spring term 2018 Autumn term 2018/19 Spring term 2019 Autumn term 2019/20 Spring term 2020 Autumn term 2020/21 Spring term 2021 Click on "Save changes". Navigate to "Site administration >Plugins > Blocks > Course overview" Allow under the "Available filters" the "Custom field" (displaygroupingcustomfield) and selectin the "Field to use" (customfiltergrouping) the "Semester". Click on "Save changes". Navigate to "Site administration >Courses > Add a new course" Create several courses and enrol a user to this course (repeating step 12): with "Semester" set to "Spring term 2020" with "Semester" set to "Autumn term 2019/20" with "Semester" set to "Spring term 2012" Standard (regression) test Login as the enrolled user Navigate to the "Dashboard" Navigate to the "Course overview" block or add one if the block is not present Click on the filter of the "Categories" Verify the "Autumn term 2019/20" option is first and "No semester" is last Fixed functionality test Login as the enrolled user Navigate to the "Dashboard" Navigate to the "Course overview" block or add one if the block is not present Click on the filter of the "Categories" Verify the "Spring term 2012" option is first and "No semester" is last

    Description

      The sorting of course custom field in the my overview block is confusing when exceeding 19 items.
      To reproduce:

      1. Go to Site administration Courses Course custom fields course/customfield.php
      2. Add a new category
      3. Add a new custom field of type dropdown field Name Semester Short name Semester and Values
        Autumn term 2011/12
        Spring term 2012
        Autumn term 2012/13
        Spring term 2013
        Autumn term 2013/14
        Spring term 2014
        Autumn term 2014/15
        Spring term 2015
        Autumn term 2015/16
        Spring term 2016
        Autumn term 2016/17
        Spring term 2017
        Autumn term 2017/18
        Spring term 2018
        Autumn term 2018/19
        Spring term 2019
        Autumn term 2019/20
        Spring term 2020
        Autumn term 2020/21
        Spring term 2021
      4. In Site administration Plugins Blocks Course overview allow "Custom field" and select "Semester" and save changes
      5. Create a course with Semester Spring term 2020
      6. Create a course with Semester Autumn term 2019/20
      7. Create a course with Semester Spring term 2012
      8. Enrol a user to those courses
      9. As that user, go to the dashboard

      WHAT YOU EXPECT
      The dropdown menu shows

      Spring term 2012
      Autumn term 2019/20
      Spring term 2020

      WHAT ACTUALLY HAPPENS
      The dropdown menu shows

      Autumn term 2019/20
      Spring term 2020
      Spring term 2012

      Attachments

        1. image-2020-11-18-10-33-32-095.png
          image-2020-11-18-10-33-32-095.png
          48 kB
        2. MDL-69526_after.png
          MDL-69526_after.png
          83 kB
        3. MDL-69526.png
          MDL-69526.png
          141 kB
        4. natsort.png
          natsort.png
          17 kB
        5. WhatsApp Image 2022-02-23 at 9.52.05 PM.jpeg
          WhatsApp Image 2022-02-23 at 9.52.05 PM.jpeg
          112 kB

        Issue Links

          Activity

            People

              lucaboesch Luca Bösch
              lucaboesch Luca Bösch
              Adrian Perez Adrian Perez
              Andrew Lyons Andrew Lyons
              Janelle Barcega Janelle Barcega
              David Woloszyn, Huong Nguyen, Jake Dallimore, Michael Hawkins, Stevani Andolo
              Votes:
              3 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                18/Jan/21

                Time Tracking

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