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

Custom reports containing "select" custom fields offer incorrect aggregation

XMLWordPrintable

    • MOODLE_402_STABLE
    • MOODLE_402_STABLE, MOODLE_403_STABLE
    • MDL-80943-403
    • Hide

      Before patch

      1. Log in as admin
      2. Navigate to Courses > Course custom fields from site administration
      3. Create a new field of type Dropdown menu
      4. Create a new field of type Short text
      5. Navigate to Reports from user menu
      6. Create a new report from Courses source
        • Include default setup: No
      7. Add Course > Course full name column to the report
      8. Add both custom field columns to the report
      9. Set aggregation for the Course full name column to "Count"
      10. Set aggregation for the menu custom field column to "Sum"
      11. Set aggregation for the text custom field column to "Comma separated values"
      12. Add the menu custom field column to the report (again)
      13. Set aggregation for the second menu custom field column to "Count"

      After patch

      1. Run upgrade
      2. Navigate to Reports from user menu
      3. Edit the previously created report
      4. Confirm the aggregation for each columns:
        • Course full name: Count
        • First menu custom field: No aggregation
        • Text custom field: Comma separated values
        • Second menu custom field: Count
      5. Open the aggregation options for one of the menu custom field columns
      6. Confirm they show only the following options:
        • No aggregation
        • Comma separated distinct values
        • Comma separated values
        • Count
        • Count distinct
      Show
      Before patch Log in as admin Navigate to Courses > Course custom fields from site administration Create a new field of type Dropdown menu Create a new field of type Short text Navigate to Reports from user menu Create a new report from Courses source Include default setup: No Add Course > Course full name column to the report Add both custom field columns to the report Set aggregation for the Course full name column to "Count" Set aggregation for the menu custom field column to "Sum" Set aggregation for the text custom field column to "Comma separated values" Add the menu custom field column to the report (again) Set aggregation for the second menu custom field column to "Count" After patch Run upgrade Navigate to Reports from user menu Edit the previously created report Confirm the aggregation for each columns: Course full name: Count First menu custom field: No aggregation Text custom field: Comma separated values Second menu custom field: Count Open the aggregation options for one of the menu custom field columns Confirm they show only the following options: No aggregation Comma separated distinct values Comma separated values Count Count distinct

      See screenshot:

      The "select" custom profile type should only allow column aggregation options suitable for text fields (concatenation, count, etc), not integer data because the column output doesn't represent numeric data (the stored value is just an index to the select field options - similar to here)

      Going forward, we can fix improve this in MDL-80941 - but for now, this is a simple bug fix to be backported

        1. Screenshot from 2024-02-14 14-43-16.png
          39 kB
          Paul Holden
        2. MDL-80943.png
          262 kB
          Ron Carl Alfon Yu

            pholden Paul Holden
            pholden Paul Holden
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            David Carrillo David Carrillo
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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