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

Report number filter causes incorrect type exception when used

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 4.0.1
    • 4.0
    • Report builder
    • MOODLE_400_STABLE
    • MOODLE_400_STABLE
    • Hide
      1. Note: there are currently no uses of the number filter in LMS, this was discovered in Workplace and a third-party plugin, hence step 2...
      2. Apply MDL-74563-test.diff patch to your site (to add a number filter to a report)
      3. Log in as admin
      4. Navigate to Reports in user menu
      5. Create new report from Users report source, with default setup
      6. Open Conditions in report editor
      7. Add User > ID condition
        • Select Greater than: 2
        • Press Apply
      8. Confirm condition is applied without exceptions
      Show
      Note: there are currently no uses of the number filter in LMS, this was discovered in Workplace and a third-party plugin, hence step 2... Apply MDL-74563-test.diff patch to your site (to add a number filter to a report) Log in as admin Navigate to Reports in user menu Create new report from Users report source, with default setup Open Conditions in report editor Add User > ID condition Select Greater than: 2 Press Apply Confirm condition is applied without exceptions

      When applying a 'number' report filter type, the following exception is thrown due to incompatible typing of parameters:

      generalexceptionmessage
      Exception - Argument 1 passed to core_reportbuilder\local\filters\number::validate_filter_values() must be of the type int, string given, called in [dirroot]/reportbuilder/classes/local/filters/number.php on line 120
      File: ...es/local/filters/number.php
      Line: 179
      Stack trace:
       
      Error code: generalexceptionmessage
      * line 179 of /reportbuilder/classes/local/filters/number.php: TypeError thrown
      * line 120 of /reportbuilder/classes/local/filters/number.php: call to core_reportbuilder\local\filters\number->validate_filter_values()
      * line 119 of /reportbuilder/classes/local/filters/base.php: call to core_reportbuilder\local\filters\number->get_sql_filter()
      * line 674 of /reportbuilder/classes/local/report/base.php: call to core_reportbuilder\local\filters\base->applies_to_values()
      * line ? of unknownfile: call to core_reportbuilder\local\report\base::core_reportbuilder\local\report\{closure}()
      * line 675 of /reportbuilder/classes/local/report/base.php: call to array_filter()
      * line 86 of /reportbuilder/classes/form/filter.php: call to core_reportbuilder\local\report\base->get_applied_filter_count()
      * line 77 of /lib/form/classes/external/dynamic_form.php: call to core_reportbuilder\form\filter->process_dynamic_submission()
      * line 261 of /lib/externallib.php: call to core_form\external\dynamic_form::execute()
      * line 81 of /lib/ajax/service.php: call to external_api::call_external_function()
      

        1. Screenshot from 2022-04-25 21-39-03.png
          94 kB
          Paul Holden
        2. MDL-74563-test.diff
          0.9 kB
          Paul Holden
        3. MDL-74563_Screenshot.PNG
          74 kB
          Gladys Basiana

            pholden Paul Holden
            pholden Paul Holden
            David Carrillo David Carrillo
            Ilya Tregubov Ilya Tregubov
            Gladys Basiana Gladys Basiana
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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