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

Messaging: Exception - Cannot access self:: when no class scope is active + last message is displayed twice

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.6
    • Fix Version/s: 3.6
    • Component/s: Messages
    • Labels:
    • Testing Instructions:
      Hide

      Setup

      1. Login as admin
      2. Allow site-wide messaging ($CFG->messagingallusers=true or via Site Admin -> Advanced features)
      3. Add the Online users block to the dashboard
      4. Create 3 users (s1, s2, s3)

      Testing scenario 1: Conversations are created (instead of throwing an exception)

      1. Access to the new user profile for s3
      2. Click over login as
      3. View the dashboard
      4. In the Online Users block, click the icon to send a message to the admin user
        • Verify you get to the messaging page to send the admin user a message
        • Verify you do not get the PHP error listed in the description of this issue
        • Verify you can send a couple of messages to the admin

       

      Testing scenario 2: Messages are displayed properly and the last message is not shown twice when it's sent by the other user

      1. Login as admin
      2. View the dashboard
      3. Load up the message/index page (YOURSITE/message/index.php) and click the user conversation you've created in the testing scenario 1 with s3
        • Verify the messages sent by the new user are displayed properly
      4. Reload the page using the browser controls but don't click anything.
        • Verify the layout of the loaded page is exactly the same as before
      5. Wait for a minute without doing anything
        • Verify the last message sent by the new user is not displayed twice
      6. Click over the user conversation
        • Verify the layout of the loaded page is exactly the same as before

       

      Testing scenario 3: The last message is not shown twice when it's sent by the current user

      1. Login as s2
      2. Logout and login as s1
      3. In the Online Users block, click the icon to send a couple of messages to the s2 user
      4. Login as s2
      5. Load up the message/index page (YOURSITE/message/index.php) and click the user conversation with s1
        • Verify the messages sent by the s1 user are displayed properly
      6. Send a message to s1
      7. Reload the page using the browser controls but don't click anything.
        • Verify the layout of the loaded page is exactly the same as before
      8. Wait for a minute without doing anything
        • Verify the message sent by s2 is not displayed twice
      Show
      Setup Login as admin Allow site-wide messaging ($CFG->messagingallusers=true or via Site Admin -> Advanced features) Add the Online users block to the dashboard Create 3 users (s1, s2, s3) Testing scenario 1: Conversations are created (instead of throwing an exception) Access to the new user profile for s3 Click over  login as View the dashboard In the Online Users block, click the icon to send a message to the admin user Verify you get to the messaging page to send the admin user a message Verify you do not get the PHP error listed in the description of this issue Verify you can send a couple of messages to the admin   Testing scenario 2: Messages are displayed properly and the last message is not shown twice when it's sent by the other user Login as admin View the dashboard Load up the message/index page (YOURSITE/message/index.php) and click the user conversation you've created in the testing scenario 1 with s3 Verify  the messages sent by the new user are displayed properly Reload the page using the browser controls but don't click anything. Verify the layout of the loaded page is exactly the same as before Wait for a minute without doing anything Verify the last message sent by the new user is not displayed twice Click over the user conversation Verify the layout of the loaded page is exactly the same as before   Testing scenario 3: The last message is not shown twice when it's sent by the current user Login as s2 Logout and login as s1 In the Online Users block, click the icon to send a couple of messages to the s2 user Login as s2 Load up the message/index page (YOURSITE/message/index.php) and click the user conversation with s1 Verify  the messages sent by the s1 user are displayed properly Send a message to s1 Reload the page using the browser controls but don't click anything. Verify the layout of the loaded page is exactly the same as before Wait for a minute without doing anything Verify the message sent by s2 is not displayed twice
    • Affected Branches:
      MOODLE_36_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-63901-master

      Description

      When accessing the message page with the id parameter set to another userid, it generates a php error:

      Exception - Cannot access self:: when no class scope is active
      Debug info: 
      Error code: generalexceptionmessage
      ×Stack trace: * line 143 of /message/index.php: Error thrown
      Continue
       

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  3/Dec/18