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

Comment submit breaks badly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Comments
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      Was looking at MDL-21344 when I tried to send one course-comment from the comments block at course level.

      And then I get this in a nasty dialog window:

      SyntaxError: Unable to parse JSON string

      ( ! ) Notice: Undefined variable: user in /Users/stronk7/git_moodle/moodle/lib/commentlib.php on line 484
      Call Stack
      #TimeMemoryFunctionLocation
      10.0005151520

      {main}( )../comment_ajax.php:0
      20.04053359136comment->add( )../comment_ajax.php:72

      ( ! ) Catchable fatal error: Argument 1 passed to core_renderer::user_picture() must be an instance of stdClass, null given in /Users/stronk7/git_moodle/moodle/lib/outputrenderers.php on line 1343
      Call Stack
      #TimeMemoryFunctionLocation
      10.0005151520{main}

      ( )../comment_ajax.php:0
      20.04053359136comment->add( )../comment_ajax.php:72
      30.07943420032bootstrap_renderer->user_picture( )../commentlib.php:484
      40.07943420624bootstrap_renderer->__call( )../setuplib.php:0
      50.08063465360call_user_func_array
      ( )../setuplib.php:873
      60.08063466032core_renderer->user_picture( )../setuplib.php:0

      ( ! ) Catchable fatal error: Argument 1 passed to user_picture::__construct() must be an instance of stdClass, null given, called in /Users/stronk7/git_moodle/moodle/lib/outputrenderers.php on line 1344 and defined in /Users/stronk7/git_moodle/moodle/lib/outputcomponents.php on line 98
      Call Stack
      #TimeMemoryFunctionLocation
      10.0005151520

      {main}

      ( )../comment_ajax.php:0
      20.04053359136comment->add( )../comment_ajax.php:72
      30.07943420032bootstrap_renderer->user_picture( )../commentlib.php:484
      40.07943420624bootstrap_renderer->__call( )../setuplib.php:0
      50.08063465360call_user_func_array
      ( )../setuplib.php:873
      60.08063466032core_renderer->user_picture( )../setuplib.php:0
      70.08083468032user_picture->__construct( )../outputrenderers.php:1344

      Error

      Coding error detected, it must be fixed by a programmer: User id is required when printing user avatar image.
      Stack trace: line 107 of /lib/outputcomponents.php: coding_exception thrownline 1344 of /lib/outputrenderers.php: call to user_picture->_construct()line ? of unknownfile: call to core_renderer->user_picture()line 873 of /lib/setuplib.php: call to call_user_func_array()line ? of unknownfile: call to bootstrap_renderer->_call()line 484 of /lib/commentlib.php: call to bootstrap_renderer->user_picture()line 72 of /comment/comment_ajax.php: call to comment->add()

        Attachments

          Activity

            People

            Assignee:
            dougiamas Martin Dougiamas
            Reporter:
            stronk7 Eloy Lafuente (stronk7)
            Tester:
            Nobody
            Participants:
            Component watchers:
            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:
              24/Nov/10