Moodle
  1. Moodle
  2. MDL-38363

PHP warnings when creating calculated question

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.6, 2.4.1, 2.5
    • Fix Version/s: 2.3.7, 2.4.4
    • Component/s: Questions
    • Labels:
    • Rank:
      48255

      Description

      I received the below while creating a new calculated question from the question bank. This came up while testing MDL-37932.

      ( ! ) Warning: Creating default object from empty value in /home/andrew/Desktop/code/moodle/int/master/question/type/calculated/questiontype.php on line 1640
      Call Stack

      1. Time Memory Function Location
        1 0.0013 361992 {main}( ) ../question.php:0
        2 0.4080 25132208 question_type->create_editing_form( ) ../question.php:200
        3 0.4142 25744864 qtype_calculated_edit_form->__construct( ) ../questiontypebase.php:217
        4 0.4143 25745120 question_edit_form->__construct( ) ../edit_calculated_form.php:67
        5 0.4151 25747344 moodleform->moodleform( ) ../edit_question_form.php:113
        6 0.4186 25832680 question_edit_form->definition( ) ../formslib.php:191
        7 0.4355 26924792 qtype_calculated_edit_form->definition_inner( ) ../edit_question_form.php:204
        8 0.4368 26983152 qtype_calculated->print_dataset_definitions_category( ) ../edit_calculated_form.php:114

        ( ! ) Warning: Creating default object from empty value in /home/andrew/Desktop/code/moodle/int/master/question/type/calculated/questiontype.php on line 1640
        Call Stack
        # Time Memory Function Location
        1 0.0013 361992 {main}

        ( ) ../question.php:0
        2 0.4080 25132208 question_type->create_editing_form( ) ../question.php:200
        3 0.4142 25744864 qtype_calculated_edit_form->__construct( ) ../questiontypebase.php:217
        4 0.4143 25745120 question_edit_form->__construct( ) ../edit_calculated_form.php:67
        5 0.4151 25747344 moodleform->moodleform( ) ../edit_question_form.php:113
        6 0.4186 25832680 question_edit_form->definition( ) ../formslib.php:191
        7 0.4355 26924792 qtype_calculated_edit_form->definition_inner( ) ../edit_question_form.php:204
        8 0.4368 26983152 qtype_calculated->print_dataset_definitions_category( ) ../edit_calculated_form.php:114

        Issue Links

          Activity

          Hide
          Tim Hunt added a comment -

          I have seen this myself, but cannot reproduce it now. I will test again tomorrow.

          Show
          Tim Hunt added a comment - I have seen this myself, but cannot reproduce it now. I will test again tomorrow.
          Hide
          Tim Hunt added a comment -

          Strangely it does happen here. Must be something funny about the PHP version on my laptop.

          Submitting a fix for integration.

          Show
          Tim Hunt added a comment - Strangely it does happen here. Must be something funny about the PHP version on my laptop. Submitting a fix for integration.
          Hide
          Eloy Lafuente (stronk7) added a comment -
          Show
          Eloy Lafuente (stronk7) added a comment - Offtopic: Wow, https://github.com/timhunt/moodle/compare/master...MDL-38363#L0R1642 wrap style is really awful!
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Integrated (23, 24 & master), thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Integrated (23, 24 & master), thanks!
          Hide
          Rajesh Taneja added a comment -

          Thanks for fixing this, Tim.

          No warnings occurred while creating calculated question.

          Show
          Rajesh Taneja added a comment - Thanks for fixing this, Tim. No warnings occurred while creating calculated question.
          Hide
          Damyon Wiese added a comment -

          This issue has been integrated upstream and is now available via git (and in some hours, via mirrors and downloads).

          Thanks for your contributions!

          Show
          Damyon Wiese added a comment - This issue has been integrated upstream and is now available via git (and in some hours, via mirrors and downloads). Thanks for your contributions!

            People

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

              Dates

              • Created:
                Updated:
                Resolved: