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

Javascript error when searching report sidebar with disabled items

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 4.0
    • 4.0
    • Report builder
    • MOODLE_400_STABLE
    • MOODLE_400_STABLE
    • Hide
      1. Log in as admin
      2. Navigate to Reports in user menu
      3. Create a new report from Cohorts report source
      4. On Editor tab search columns for "Name"
      5. Confirm Cohort and User cards are visible, listing columns matching the search
      6. Confirm Cohort member card is not visible
      7. Clear the search
      8. Confirm all cards (Cohort, Cohort member and User) are now visible, along with each column within
      9. Press Audience tab
      10. If Member of cohort isn't disabled then delete all cohorts and reload tab
      11. Search audience types for "User"
      12. Confirm only All users and Manually added users are displayed
      13. Confirm there are no JS errors in your browser console
      Show
      Log in as admin Navigate to Reports in user menu Create a new report from Cohorts report source On Editor tab search columns for "Name" Confirm Cohort and User cards are visible, listing columns matching the search Confirm Cohort member card is not visible Clear the search Confirm all cards ( Cohort , Cohort member and User ) are now visible, along with each column within Press Audience tab If Member of cohort isn't disabled then delete all cohorts and reload tab Search audience types for "User" Confirm only All users and Manually added users are displayed Confirm there are no JS errors in your browser console

    Description

      When searching report audience types, where there is a disabled type (e.g. on a brand new install, Cohort members is disabled because there are no cohorts) you receive the following JS error because the disabled type have no dataset:

      Uncaught TypeError: item.dataset.name is undefined
          sidebarCardFilter http://localhost:8000/lib/requirejs.php/1648541545/core_form/events.js:2278
          sidebarCardFilter http://localhost:8000/lib/requirejs.php/1648541545/core_form/events.js:2278
          timeout http://localhost:8000/lib/requirejs.php/1648541545/core_form/events.js:713
          setTimeout handler*_exports.debounce/< http://localhost:8000/lib/requirejs.php/1648541545/core_form/events.js:713
          init http://localhost:8000/lib/requirejs.php/1648541545/core_form/events.js:2278
          init http://localhost:8000/lib/requirejs.php/1648541545/core_form/events.js:2278
          <anonymous> http://localhost:8000/reportbuilder/edit.php?id=6#audience line 2 > injectedScript:3
          execCb http://localhost:8000/lib/javascript.php/1648541545/lib/requirejs/require.min.js:5
          check http://localhost:8000/lib/javascript.php/1648541545/lib/requirejs/require.min.js:5
          enable http://localhost:8000/lib/javascript.php/1648541545/lib/requirejs/require.min.js:5
          init http://localhost:8000/lib/javascript.php/1648541545/lib/requirejs/require.min.js:5
          o http://localhost:8000/lib/javascript.php/1648541545/lib/requirejs/require.min.js:5
          setTimeout handler*req.nextTick< http://localhost:8000/lib/javascript.php/1648541545/lib/requirejs/require.min.js:5
          o http://localhost:8000/lib/javascript.php/1648541545/lib/requirejs/require.min.js:5
          requirejs http://localhost:8000/lib/javascript.php/1648541545/lib/requirejs/require.min.js:5
          <anonymous> http://localhost:8000/reportbuilder/edit.php?id=6#audience line 2 > injectedScript:2
          jQuery 3
          runTemplateJS http://localhost:8000/lib/requirejs.php/1648541545/core_form/events.js:79
          domReplace http://localhost:8000/lib/requirejs.php/1648541545/core_form/events.js:79
          replaceNodeContents http://localhost:8000/lib/requirejs.php/1648541545/core_form/events.js:79
          loadTab http://localhost:8000/lib/requirejs.php/1648541545/core_form/events.js:231
          jQuery 32
      events.js:2278:1543
      

      There is a second problem with the sidebar searching, in that card headings should be hidden when they contain no matching items but that doesn't seem to currently work:

      Attachments

        1. MDL-74353_1.png
          MDL-74353_1.png
          79 kB
        2. MDL-74353_2.png
          MDL-74353_2.png
          76 kB
        3. MDL-74353_3.png
          MDL-74353_3.png
          47 kB
        4. Screenshot_2022-03-29 Second.png
          Screenshot_2022-03-29 Second.png
          11 kB
        5. Screenshot from 2022-03-29 09-13-46.png
          Screenshot from 2022-03-29 09-13-46.png
          167 kB

        Activity

          People

            pholden Paul Holden
            pholden Paul Holden
            David Matamoros David Matamoros
            Ilya Tregubov Ilya Tregubov
            Angelia Dela Cruz Angelia Dela Cruz
            Carlos Castillo, David Matamoros, Mikel Martín Corrales, Paul Holden
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              19/Apr/22

              Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 55 minutes
                55m