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

Notice rendering user pictures for deleted users

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.2
    • Component/s: General, Libraries
    • Labels:
    • Testing Instructions:
      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
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w48_MDL-30457_m22_deluserspictures

      Description

      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

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              skodak Petr Skoda
              Reporter:
              stronk7 Eloy Lafuente (stronk7)
              Integrator:
              Sam Hemelryk
              Tester:
              Sam Hemelryk
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                5/Dec/11