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

Report audience exporter doesn't uniquely key the menu cards

    XMLWordPrintable

Details

    • MOODLE_401_STABLE
    • MOODLE_401_STABLE
    • MDL-76812-401
    • Hide
      1. Make the following change:

        diff --git a/reportbuilder/classes/external/custom_report_audience_cards_exporter.php b/reportbuilder/classes/external/custom_report_audience_cards_exporter.php
        index 561e140..c13c8ed 100644
        --- a/reportbuilder/classes/external/custom_report_audience_cards_exporter.php
        +++ b/reportbuilder/classes/external/custom_report_audience_cards_exporter.php
        @@ -57,7 +57,7 @@ class custom_report_audience_cards_exporter extends custom_report_menu_cards_exp
                         if ($plugininfo = core_plugin_manager::instance()->get_plugin_info($component)) {
                             $componentname = $plugininfo->displayname;
                         } else {
        -                    $componentname = get_string('site');
        +                    $componentname = random_string(5);//get_string('site');
                         }
         
                         // New menu card per component.
        

      2. Navigate to Reports from user menu
      3. Create a new report
      4. Press Audience tab in editor
      5. Confirm each of the menu cards (with random names) can be opened/closed independently of the others
      Show
      Make the following change: diff --git a/reportbuilder/classes/external/custom_report_audience_cards_exporter.php b/reportbuilder/classes/external/custom_report_audience_cards_exporter.php index 561e140..c13c8ed 100644 --- a/reportbuilder/classes/external/custom_report_audience_cards_exporter.php +++ b/reportbuilder/classes/external/custom_report_audience_cards_exporter.php @@ -57,7 +57,7 @@ class custom_report_audience_cards_exporter extends custom_report_menu_cards_exp if ($plugininfo = core_plugin_manager::instance()->get_plugin_info($component)) { $componentname = $plugininfo->displayname; } else { - $componentname = get_string('site'); + $componentname = random_string(5);//get_string('site'); } // New menu card per component. Navigate to Reports from user menu Create a new report Press Audience tab in editor Confirm each of the menu cards (with random names) can be opened/closed independently of the others

    Description

      The audience card index is reset to 0 inside the loop: https://github.com/moodle/moodle/blob/b8b905cd90f7a1d0db59a70a32d47e015dcfbfea/reportbuilder/classes/external/custom_report_audience_cards_exporter.php#L62-L67 (it should be initialized before the loop)

      This means the menu cards do not collapse independently of one another, because they all have the same key, more noticeable in Workplace because we have audience types from multiple plugins but can be replicated in LMS by randomising the card names:

      Regression from MDL-74600 (and the same thing we previously fixed at MDL-73811)

      Attachments

        1. 401.gif
          401.gif
          339 kB
        2. master.gif
          master.gif
          400 kB
        3. Screencast 2023-01-06.gif
          Screencast 2023-01-06.gif
          362 kB

        Issue Links

          Activity

            People

              pholden Paul Holden
              pholden Paul Holden
              Ruslan Kabalin Ruslan Kabalin
              Jun Pataleta Jun Pataleta
              Ron Carl Alfon Yu Ron Carl Alfon Yu
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 4 minutes
                  1h 4m

                  Clockify

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