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

NEWMODULE errors in Moodle 2

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.0.1
    • 2.0
    • Module: Newmodule
    • None
    • Easy
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE

      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...

            jerome Jérôme Mouneyrac
            jp76 Jason Platts
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.