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

Review implementations of xxxx_pluginfile() functions in core

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.7
    • Fix Version/s: None
    • Component/s: Files API
    • Labels:
    • Affected Branches:
      MOODLE_27_STABLE

      Description

      While integrating MDL-39929, it was detected that different implementations of the xxxx_pluginfile() methods (mainly in activity modules) were showing some inconsistencies/differences that would be worth reviewing.

      Some of them include:

      • Handling of the $forcedownload parameter, sometimes used, other ignored when finally sending the file.
      • Potentially missing the $options param when sending the file.
      • Heterogeneous use of require_login() and require_course_login(), sometimes allowing autologinguests, others forbidding it.
      • Different implementations (sometimes using a big "switch case" like conditional use of "if...else", others sending not found...
      • ...

      In any case, we should review them and, while assuming they are working, try to homogenize (and cover with acceptance tests) all them. For clarity and because core implementations are often used as a reference for devs out there.

      That is it, ciao

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                stronk7 Eloy Lafuente (stronk7)
                Participants:
                Component watchers:
                Matteo Scaramuccia, Jake Dallimore, Jun Pataleta, Ryan Wyllie
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: