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

NEWMODULE few improvements

    XMLWordPrintable

    Details

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

      Description

      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

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

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