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

Allow callers to define report aggregation options

XMLWordPrintable

    • MOODLE_500_STABLE
    • MOODLE_500_STABLE
    • Hide
      1. Log in as admin
      2. Navigate to Reports from user menu
      3. Create a couple of reports, add multiple tags to each
      4. Confirm the styled tag badges are separated by a space in the list of custom reports
      5. Make the following change:

        $ git diff
        diff --git a/reportbuilder/classes/local/systemreports/reports_list.php b/reportbuilder/classes/local/systemreports/reports_list.php
        index e695dfb62b4..f404d35e031 100644
        --- a/reportbuilder/classes/local/systemreports/reports_list.php
        +++ b/reportbuilder/classes/local/systemreports/reports_list.php
        @@ -163,7 +163,7 @@ class reports_list extends system_report {
                 // Tags column.
                 $this->add_column_from_entity('tag:namewithbadge')
                     ->set_title(new lang_string('tags'))
        -            ->set_aggregation('groupconcat')
        +            ->set_aggregation('groupconcat', [])
                     ->set_is_available(core_tag_tag::is_enabled('core_reportbuilder', 'reportbuilder_report') === true);
         
                 // Time created column.
        

      6. Reload the list of reports
      7. Confirm the tags are separated by comma (default aggregation behaviour)
      8. Make the following change:

        $ git diff
        diff --git a/reportbuilder/classes/local/systemreports/reports_list.php b/reportbuilder/classes/local/systemreports/reports_list.php
        index e695dfb62b4..5fbb3dc313e 100644
        --- a/reportbuilder/classes/local/systemreports/reports_list.php
        +++ b/reportbuilder/classes/local/systemreports/reports_list.php
        @@ -163,7 +163,7 @@ class reports_list extends system_report {
                 // Tags column.
                 $this->add_column_from_entity('tag:namewithbadge')
                     ->set_title(new lang_string('tags'))
        -            ->set_aggregation('groupconcat')
        +            ->set_aggregation('groupconcat', ['separator' => '<br />'])
                     ->set_is_available(core_tag_tag::is_enabled('core_reportbuilder', 'reportbuilder_report') === true);
         
                 // Time created column.
        

      9. Reload the list of reports
      10. Confirm the tags are separated by new line (override column/aggregation behaviour)
      Show
      Log in as admin Navigate to Reports from user menu Create a couple of reports, add multiple tags to each Confirm the styled tag badges are separated by a space in the list of custom reports Make the following change: $ git diff diff --git a/reportbuilder/classes/local/systemreports/reports_list.php b/reportbuilder/classes/local/systemreports/reports_list.php index e695dfb62b4..f404d35e031 100644 --- a/reportbuilder/classes/local/systemreports/reports_list.php +++ b/reportbuilder/classes/local/systemreports/reports_list.php @@ -163,7 +163,7 @@ class reports_list extends system_report { // Tags column. $this->add_column_from_entity('tag:namewithbadge') ->set_title(new lang_string('tags')) - ->set_aggregation('groupconcat') + ->set_aggregation('groupconcat', []) ->set_is_available(core_tag_tag::is_enabled('core_reportbuilder', 'reportbuilder_report') === true); // Time created column. Reload the list of reports Confirm the tags are separated by comma (default aggregation behaviour) Make the following change: $ git diff diff --git a/reportbuilder/classes/local/systemreports/reports_list.php b/reportbuilder/classes/local/systemreports/reports_list.php index e695dfb62b4..5fbb3dc313e 100644 --- a/reportbuilder/classes/local/systemreports/reports_list.php +++ b/reportbuilder/classes/local/systemreports/reports_list.php @@ -163,7 +163,7 @@ class reports_list extends system_report { // Tags column. $this->add_column_from_entity('tag:namewithbadge') ->set_title(new lang_string('tags')) - ->set_aggregation('groupconcat') + ->set_aggregation('groupconcat', ['separator' => '<br />']) ->set_is_available(core_tag_tag::is_enabled('core_reportbuilder', 'reportbuilder_report') === true); // Time created column. Reload the list of reports Confirm the tags are separated by new line (override column/aggregation behaviour)
    • Hide

      Code verified against automated checks.

      Checked MDL-84537 using repository: https://github.com/paulholden/moodle/

      More information about this report

      Built on: Sun Mar 9 20:26:36 UTC 2025

      Show
      Code verified against automated checks. Checked MDL-84537 using repository: https://github.com/paulholden/moodle/ main (0 errors / 0 warnings) [branch: MDL-84537 | CI Job ] More information about this report Built on: Sun Mar 9 20:26:36 UTC 2025
    • Hide

      Launching automatic jobs for branch MDL-84537

      Built on: Sun Mar 9 20:23:24 UTC 2025

      Show
      Launching automatic jobs for branch MDL-84537 https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/18492/ PHPUnit (sqlsrv / --testsuite core_reportbuilder_testsuite) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/63309/ Behat (NonJS - boost and classic / --tags @core_reportbuilder) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/63310/ Behat (Firefox - boost / --tags @core_reportbuilder) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/63311/ Behat (Firefox - classic / --tags @core_reportbuilder) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/63312/ App tests (stable app version) / --tags @core_reportbuilder) Built on: Sun Mar 9 20:23:24 UTC 2025

      This follows on from improvements being made in MDL-84527 to create styled mini-"tag clouds" - we want a means for callers to define options for applied aggregation types, specifically in this case to control the separator between group concatenated items

      In this issue:

      1. Define a generic API to pass options to aggregation types;
      2. Allow for system reports to pass these options to columns;
      3. Allow for entities to define these options for their columns;
      4. Add option to the group concatenation types to allow for custom separator
      5. Use in reports listing page

      This will also allow us to clean up some gnarly report column definitions in Workplace

        1. MDL-84537.png
          461 kB
          Ron Carl Alfon Yu

            pholden Paul Holden
            pholden Paul Holden
            Pedro Jordao Pedro Jordao
            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 - 2 days, 4 hours, 23 minutes
                2d 4h 23m

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