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

              Assignee:
              ankit_frenz Ankit Agarwal
              Reporter:
              skylarkelty Skylar Kelty
              Peer reviewer:
              Ankit Agarwal
              Integrator:
              David Monllaó
              Tester:
              cameron1729
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Matteo Scaramuccia, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                8/May/17