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

Multiple calls to update_shipped_tours() in upgrade. Ways to avoid that.

    XMLWordPrintable

    Details

    • Affected Branches:
      MOODLE_37_STABLE

      Description

      With this is not critical at all, it's a good case exposing how there is some stuff, update_shipped_tours() for example, that can end being called multiple time in different steps of a component upgrade.php

      This is about see which alternatives are, and decide how to handle these cases in general, documenting it and, in particular, fixing the update_shipped_tours() case.

      There are various alternatives:

      A - Allow code to happen unconditionally out from upgrade savepoints. So arbitrary code can be executed and the beginning or the end.
      B - Achieve the arbitrary code execution by supporting my some new post-upgrade php script (similar to install.php).
      C - Build some mechanishm within the called code, so it' sonly executed once.
      D - Simply, remove the old calls, keeping always the last one.

      And that's all. Feel free to add more alternatives or comment about any of them.

      Ciao

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                stronk7 Eloy Lafuente (stronk7)
                Participants:
                Component watchers:
                Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Matteo Scaramuccia, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: