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

Notice rendering user pictures for deleted users

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 2.2
    • 2.2
    • General, Libraries
    • MOODLE_22_STABLE
    • MOODLE_22_STABLE
    • w48_MDL-30457_m22_deluserspictures
    • Easy
    • Hide

      1/ post something as student into one forum
      2/ delete the user
      3/ visit the forum
      4/ click on course profile link
      5/ visit system profile for that user

      no warnings or errors expected

      Show
      1/ post something as student into one forum 2/ delete the user 3/ visit the forum 4/ click on course profile link 5/ visit system profile for that user no warnings or errors expected

      While testing MDL-30192 another regression of MDL-29602 was found.

      Once again code assumes get_context_instance() will always return one context for any user and that's not try for 2.2 anymore.

      To reproduce:

      1) in any course, delete one user having some forum posts.
      2) visit the forum/discussion with contents from the deleted user.
      3) you will get this, as many times as the user picture is rendered.

      Notice: Trying to get property of non-object in /lib/outputcomponents.php on line 305
      Call Stack
      #	Time	Memory	Function	Location
      1	0.0001	637480	{main}( )	../view.php:0
      2	0.4719	16241480	forum_print_latest_discussions( )	../view.php:239
      3	0.4826	16304992	forum_print_discussion_header( )	../lib.php:5352
      4	0.4828	16306192	core_renderer->user_picture( )	../lib.php:3650
      5	0.4828	16308040	renderer_base->render( )	../outputrenderers.php:1780
      6	0.4828	16308128	core_renderer->render_user_picture( )	../outputrenderers.php:70
      7	0.4830	16308312	user_picture->get_url( )	../outputrenderers.php:1817

            skodak Petr Skoda
            stronk7 Eloy Lafuente (stronk7)
            Sam Hemelryk Sam Hemelryk
            Sam Hemelryk Sam Hemelryk
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.