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

Editing a non-core module grade producing a php notice message and prevents the page from redirecting automatically

    Details

    • Testing Instructions:
      Hide

      Log in as an admin/instructor
      Go into the course and click Grades
      Turn on editing
      Click the hand/edit icon for a grade item
      Check 'locked' and save
      Go back and edit that same grade
      Un-check 'locked' click save
      No error should be displayed.

      Note: depending on your configuration you may see a warning like "Reduced maximum students per page from 100 to 83. Consider increasing the PHP setting max_input_vars from 1000." on your grader report. That is unrelated.

      Install a contributed activity that can have a grade. For example, http://moodle.org/plugins/view.php?plugin=assignment_onlineaudio which is installed in /mod/assignment/type/onlineaudio and is a new sub type for the old assignment module. Create an instance. This may display some warning along the way that are unrelated. Go into the grade book. Lock then unlock the grade for a student for the online audio activity. You should not get any warnings or errors during the locking/unlocking process.

      Show
      Log in as an admin/instructor Go into the course and click Grades Turn on editing Click the hand/edit icon for a grade item Check 'locked' and save Go back and edit that same grade Un-check 'locked' click save No error should be displayed. Note: depending on your configuration you may see a warning like "Reduced maximum students per page from 100 to 83. Consider increasing the PHP setting max_input_vars from 1000." on your grader report. That is unrelated. Install a contributed activity that can have a grade. For example, http://moodle.org/plugins/view.php?plugin=assignment_onlineaudio which is installed in /mod/assignment/type/onlineaudio and is a new sub type for the old assignment module. Create an instance. This may display some warning along the way that are unrelated. Go into the grade book. Lock then unlock the grade for a student for the online audio activity. You should not get any warnings or errors during the locking/unlocking process.
    • Affected Branches:
      MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull Master Branch:
      MDL-30880_feedback_property

      Description

      Editing a grade for a non-core module in the gradebook, checking locked and then un-checking locked produces a PHP notice and prevents the page from redirecting automatically.

      Reproduction steps:

      1. Log in as an admin/instructor
      2. Go into the course and click Grades
      3. Turn on editing
      4. Edit the grade for the non-core plug-in
      5. Check 'locked' and save
      6. Go back and edit that same grade
      7. Un-check 'locked' click save
      8. The page displays the following message

        Notice: Undefined property: stdClass::$feedback in /var/www/html/ack/testsite/grade/edit/tree/grade.php on line 165 Call Stack: 0.0019 779336 1.

        Unknown macro: {main}

        () /var/www/html/ack/testsite/grade/edit/tree/grade.php:0
        Skip to main content

        This page should automatically redirect. If nothing is happening please use the continue link below.
        (Continue)

        Error output, so disabling automatic redirect.

      Here is the line of code that produces that notice message

          if (is_array($data->feedback)) {
              $data->feedbackformat = $data->feedback['format'];
              $data->feedback = $data->feedback['text'];
          }

      The code should first check to see if the feedback property exists and then check to see if it is an array

          if (isset($data->feedback) && is_array($data->feedback)) {
              $data->feedbackformat = $data->feedback['format'];
              $data->feedback = $data->feedback['text'];
          }

      The same thing happens when editing core graded modules but for some reason the notice message does not appear.

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  9/Jul/12