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

Suggestion: Param name + two checks to upgrade_plugin_savepoint()

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Installation
    • Labels:
      None
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      Hi, while working on xmldb editor support to upgrade_plugin_savepoint() calls... I found this:

      1) the 4th parameter $dir ... perhaps it's clear if it is defined as $name, because it can lead to confussion with plugins stored under "type" dirs and others. That doesn't matter and it's the name of the plugin dir always.
      2) To prevent some mistakes, the $type could be checked against get_plugin_types() to see if it's a valid type.
      3) Once verified 2) it's easy to perform one dir_exists() to check that the exact plugin exists.

      Just a suggestion. I've added tehm as TODOs in the upgrade_plugin_savepoint() function. FYC

      Ciao

        Attachments

          Activity

            People

            • Assignee:
              skodak Petr Skoda
              Reporter:
              stronk7 Eloy Lafuente (stronk7)
              Participants:
              Component watchers:
              Matteo Scaramuccia, Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                24/Nov/10