Moodle
  1. Moodle
  2. MDL-25529

adding NEWMODULE throws some notices

    Details

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

      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
      

        Issue Links

          Activity

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

          waiting for review

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

          fixed, thanks for Eloy to review on github.

          Show
          Jérôme Mouneyrac added a comment - fixed, thanks for Eloy to review on github.
          Hide
          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 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
          Jérôme Mouneyrac added a comment -

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

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

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

          Show
          Jérôme Mouneyrac added a comment - - edited argh Jira and its token that expire after 5 minutes lost again my comment...
          Hide
          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
          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
          Petr Škoda added a comment -

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

          Show
          Petr Škoda added a comment - Jerome: Please ask for review before changing code in core. Dongsheng: Thanks for reverting the change.
          Hide
          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
          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
          David Mudrak added a comment -

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

          Show
          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: