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

Cannot call get_plugins_supporting_mobile multiple times in one request

    XMLWordPrintable

Details

    Description

      Multiple calls to get_plugins_supporting_mobile results in a bunch of "undefined variable $addons" spamming the page.

      This is because under get_plugins_supporting_mobile there is a "require_once" which will require the mobile.php only once, therefore any subsequent call will not succeed as the file will not be included and $addons will not be there.

      There are three possible solutions to this:

      1. Change the require_once to a require
      2. Change $pluginsinfo to a static variable and only build it once
      3. Add MUC caching

      Adding MUC caching seems appropriate as this API endpoint is called multiple times by admin settings pages as well as by the mobile app.

      Attachments

        Issue Links

          Activity

            People

              ankit_frenz Ankit Agarwal
              skylarkelty Skylar Kelty
              Ankit Agarwal Ankit Agarwal
              David Monllaó David Monllaó
              cameron1729 cameron1729
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Clockify

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