Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-3571

Filters: core_filters_get_available_in_context call can exceed PHP input variables limit

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 3.9.3
    • 3.9.2
    • Filters
    • Hide

      This issue only needs to be tested in 1 device.

      1. In web, in a master site as teacher/admin, create a course with more than 500 activities. The MM Dev Testing course currently has around 330.
      2. In the app, open the course. Check that you aren't required to reauthenticate and no error is displayed.
      Show
      This issue only needs to be tested in 1 device. In web, in a master site as teacher/admin, create a course with more than 500 activities. The MM Dev Testing course currently has around 330. In the app, open the course. Check that you aren't required to reauthenticate and no error is displayed.
    • MOODLE_39_STABLE
    • MOODLE_39_STABLE
    • Moodle App 3.9.3

      The app calls core_filters_get_available_in_context to request information about all the activity contexts on a course. If there are a large number of activities on the course, this can hit the PHP input variable limit because there are a large number of parameters in the request (2 per context). Here is an example $_REQUEST object:

      Array
      (
      [moodlewsrestformat] => json
      [wsfunction] => core_filters_get_available_in_context
      [contexts] => Array
      (
      [0] => Array
      (
      [contextlevel] => module
      [instanceid] => 1605576
      )
      (....lots of entries omitted…)
      [499] => Array
      (
      [contextlevel] => module
      [instanceid] => 1606071
      )

      [500] => Array
      (
      [contextlevel] => module
      )
      )
      )

      In the above example, entry 500 only had half the data, there should have been other entries after 500, and the final 'wstoken' value has been chopped off, because the PHP max_input_vars setting on the server (set to default, 1000) has been exceeded.

      The request fails due to invalid token (since it wasn't supplied), which can cause the user to be prompted to log in again.

      The app should probably make this request in batches if there is a very large number (e.g. > 400).

            dpalou Dani Palou
            quen Sam Marshall
            Pau Ferrer Pau Ferrer
            Juan Leyva Juan Leyva
            Isabel Renedo Rouco Isabel Renedo Rouco
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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