Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-2508

NEWMODULE errors in Moodle 2

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0.1
    • Component/s: Module: Newmodule
    • Labels:
      None
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      The NEWMODULE stub module has some issues working with Moodle 2.

      1. You cannot add a module instance to a course (DB errors).
      2. You cannot view the module (url error).

      To resolve 1:

      There is no function newmodule_supports in lib.php. This needs to be added and support for FEATURE_MOD_INTRO enabled. example:

      function newmodule_supports($features) {
      switch($feature)

      { case FEATURE_MOD_INTRO: return true; default: return null; }

      }

      In the DB record for the module instance timemodified is expected to not be null. When adding an instance this is not set. Function newmodule_add_instance in lib.php needs amending to also set this value, e.g.:
      $newmodule->timemodified = $newmodule->timecreated;

      To resolve 2:
      In view.php line 56 should have a forward slash before the path e.g.:
      $PAGE->set_url('/mod/newmodule...

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jerome Jérôme Mouneyrac
              Reporter:
              jp76 Jason Platts
              Participants:
              Component watchers:
              David Mudrák (@mudrd8mz)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                25/Dec/10