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

NEWMODULE few improvements

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • 2.0.1
    • 2.0
    • Module: Newmodule
    • None
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE

      I just tried the NEWMODULE from contrib:

      upgrade.php:

      • add

        $dbman = $DB->get_manager(); // loads ddl manager and xmldb classes

      • change the global $db for $DB
      • update all examples (add_index => $dbman->add_field ...)
      • remove the $CFG, $THEME
      • I noticed that xmldb editor generate code like:

        if ($oldversion < XXXXXXXX) {...}

      The example is always:

      if ($result && $oldversion < XXXXXXXX) {...}

      README:

      • mention that the default module code requires the table and 'intro'/'introformat' fields in the default install.xml.

      view.php:

      • $PAGE->set_url('mod/championship/view.php', array('id' => $cm->id));

        causes a Default exception handler: Coding error detected, it must be fixed by a programmer: Invalid parameter $url, has to be full url or in shortened form starting with /.
        Replace it with

        $PAGE->set_url('/mod/championship/view.php', array('id' => $cm->id));

      Note that there is few notices/warnings around. For example:

      PHP Notice: Invalid get_string() identifier: 'pluginadministration' or component 'championship'<ul style="text-align: left"><li>line 6058 of /lib/moodlelib.php: call to debugging()</li><li>line 6613 of /lib/moodlelib.php: call to core_string_manager->get_string()</li><li>line 3104 of /lib/navigationlib.php: call to get_string()</li><li>line 2569 of /lib/navigationlib.php: call to settings_navigation->load_module_settings()</li><li>line 583 of /lib/pagelib.php: call to settings_navigation->initialise()</li><li>line 599 of /lib/pagelib.php: call to moodle_page->magic_get_settingsnav()</li><li>line 134 of /blocks/settings/block_settings.php: call to moodle_page->__get()</li><li>line 279 of /blocks/moodleblock.class.php: call to block_settings->get_content()</li><li>line 232 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()</li><li>line 882 of /lib/blocklib.php: call to block_base->get_content_for_output()</li><li>line 934 of /lib/blocklib.php: call to block_manager->create_block_contents()</li><li>l in /Users/jerome/Documents/Projects/Moodle_HEAD/moodle/lib/weblib.php on line 2855

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

              Created:
              Updated:
              Resolved:

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