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

Bad argument passed to core_renderer::user_picture() in mod_assign renderer

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5.3, 3.6.2, 3.7
    • Fix Version/s: 3.5.5, 3.6.3
    • Component/s: Assignment
    • Labels:

      Description

      Environment:

      Moodle 3.5.2+ (Build: 20181031)
      mod_assign 2018051400
      mariadb 5.5.56 2
      php 7.1.2
      CentOS Linux release 7.5.1804
      Apache / 2.4.6

      Reproduction of the error:
      1. the teacher creates an assignment via mod_assign
      2. The student submits an assignment and validates it for evaluation
      3. The teacher authorizes a new attempt for the student WITHOUT having noted it on his first attempt
      4. the student tries to go back to the assignement, the error appears

      Fault:
      Exception: Argument 1 passed to core_renderer :: user_picture () must be an instance of stdClass, string given, called in [dirroot] /mod/assign/renderer.php on line 1106.

      Code causing the error:

      In [dirroot] /mod/assign/renderer.php on line +/- 1106:

      $ cell2 = new html_table_cell ($ this-> output-> user_picture ($ grade-> grader).
      $ this-> output-> spacer (array ('width' => 30)). fullname ($ grade-> grader));

      Assumption:
      $ grade-> grader is null, empty or different from what is expected because the previous assignment was not rated then there is no grader

      Patch:
      Removing the call to user_picture makes the problem no longer appears. It's a dirty patch because I'm not able to measure the other implications of the problem:

      In [dirroot] /mod/assign/renderer.php on line +/- 1106:

       

      // Graded by.
      $ cell1 = new html_table_cell ($ gradedbystr);
      // $ cell2 = new html_table_cell ($ this-> output-> user_picture ($ grade-> grader).
      // $ this-> output-> spacer (array ('width' => 30)). fullname ($ grade-> grader));
      // Nicolas 12/11/18: patch to work around a programming error
      $ cell2 = new html_table_cell ($ this-> output-> spacer (array ('width' => 30)). fullname ($ grade-> grader));
      

       

       

       

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/Mar/19

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 30 minutes
                  30m