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

adding NEWMODULE throws some notices

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Not a bug
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Component/s: Course
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE

      Description

      When I add a newmodule module (from NEWMODULE contrib module), I see the following notice:

      [03-Dec-2010 13:40:51] PHP Notice:  Undefined variable: introeditor in /Users/jerome/Documents/Projects/Moodle_Git_PHPStorm/Moodle_for_plugins/course/modedit.php on line 435
      [03-Dec-2010 13:40:51] PHP Notice:  Undefined variable: introeditor in /Users/jerome/Documents/Projects/Moodle_Git_PHPStorm/Moodle_for_plugins/course/modedit.php on line 437

        Gliffy Diagrams

          Issue Links

            Activity

            Show
            jerome Jérôme Mouneyrac added a comment - https://github.com/mouneyrac/moodle/commit/485824f4a39cc9e40d20c125f94a251244060de7
            Hide
            jerome Jérôme Mouneyrac added a comment -

            waiting for review

            Show
            jerome Jérôme Mouneyrac added a comment - waiting for review
            Hide
            jerome Jérôme Mouneyrac added a comment -

            fixed, thanks for Eloy to review on github.

            Show
            jerome Jérôme Mouneyrac added a comment - fixed, thanks for Eloy to review on github.
            Hide
            dongsheng Dongsheng Cai added a comment - - edited

            Jerome, I have to revert the change, the previous commit broken module instance creating page (it breaks every module creating page), I got following error:
            Debug info: Column 'intro' cannot be null
            UPDATE mdl_chat SET intro = NULL WHERE id = ?
            [array (
            0 => 1,
            )]
            Stack trace:

            • line 394 of /lib/dml/moodle_database.php: dml_write_exception thrown
            • line 1021 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
            • line 1441 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->set_field_select()
            • line 434 of /course/modedit.php: call to moodle_database->set_field()
            Show
            dongsheng Dongsheng Cai added a comment - - edited Jerome, I have to revert the change, the previous commit broken module instance creating page (it breaks every module creating page), I got following error: Debug info: Column 'intro' cannot be null UPDATE mdl_chat SET intro = NULL WHERE id = ? [array ( 0 => 1, )] Stack trace: line 394 of /lib/dml/moodle_database.php: dml_write_exception thrown line 1021 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end() line 1441 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->set_field_select() line 434 of /course/modedit.php: call to moodle_database->set_field()
            Hide
            jerome Jérôme Mouneyrac added a comment -

            thanks dongsheng, I have a look to an alternative...

            Show
            jerome Jérôme Mouneyrac added a comment - thanks dongsheng, I have a look to an alternative...
            Hide
            jerome Jérôme Mouneyrac added a comment - - edited

            argh Jira and its token that expire after 5 minutes lost again my comment...

            Show
            jerome Jérôme Mouneyrac added a comment - - edited argh Jira and its token that expire after 5 minutes lost again my comment...
            Hide
            jerome Jérôme Mouneyrac added a comment -

            to make it quick:

            From CVS history I saw Petr is maintaining this part. Here is a quick fix (but it definitively can be improved):

            in my previous fix instead the one line:

            if (empty($introeditor)) {
               $introeditor = $fromform->introeditor;
            }

            Note: this 'code logic' issue seems to have been introduced when if() condition has appeared around the $introeditor declaration...

            Show
            jerome Jérôme Mouneyrac added a comment - to make it quick: From CVS history I saw Petr is maintaining this part. Here is a quick fix (but it definitively can be improved): in my previous fix instead the one line: if (empty($introeditor)) { $introeditor = $fromform->introeditor; } Note: this 'code logic' issue seems to have been introduced when if() condition has appeared around the $introeditor declaration...
            Hide
            skodak Petr Skoda added a comment -

            Jerome: Please ask for review before changing code in core.
            Dongsheng: Thanks for reverting the change.

            Show
            skodak Petr Skoda added a comment - Jerome: Please ask for review before changing code in core. Dongsheng: Thanks for reverting the change.
            Hide
            jerome Jérôme Mouneyrac added a comment -

            As I wrote previously, Eloy reviewed it in github.
            Plus it didn't break every modules as the one I tested worked (newmodule)

            Show
            jerome Jérôme Mouneyrac added a comment - As I wrote previously, Eloy reviewed it in github. Plus it didn't break every modules as the one I tested worked (newmodule)
            Hide
            mudrd8mz David Mudrak added a comment -

            Changing core because of NEWMODULE sounds a bit weird. Is not the problem in NEWMODULE instead?

            Show
            mudrd8mz David Mudrak added a comment - Changing core because of NEWMODULE sounds a bit weird. Is not the problem in NEWMODULE instead?

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: