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

Replace add_to_log with an event trigger - message

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6
    • Fix Version/s: 2.7
    • Component/s: Messages
    • Labels:
    • Testing Instructions:
      Hide
      Test 1
      1. Run the phpunit tests in message/tests/events_test.php and ensure all passes as expected.
      Test 2
      1. Open up <yoursite>/report/log/index.php in another tab and use this page to check that there is a log when asked.
      2. Log into a site that has at least two users.
      3. Click on your name to take you to your profile.
      4. Click on 'My profile' then 'Messages'.
      5. Type the name of another user and click 'Search people and messages'.
      6. Click on the '+' next to the name and check that there is a log entry 'message add contact'.
      7. Click 'Block contact' on the right and check that there is a 'message block contact' log entry.
      8. Click 'Unblock the contact' and check that there is a 'message unblock contact' log entry.
      9. Send the user a message and check that there is a 'message write' log entry.
      10. Remove the contact and check that there is a 'message remove contact' log entry.
      Show
      Test 1 Run the phpunit tests in message/tests/events_test.php and ensure all passes as expected. Test 2 Open up <yoursite>/report/log/index.php in another tab and use this page to check that there is a log when asked. Log into a site that has at least two users. Click on your name to take you to your profile. Click on 'My profile' then 'Messages'. Type the name of another user and click 'Search people and messages'. Click on the '+' next to the name and check that there is a log entry 'message add contact'. Click 'Block contact' on the right and check that there is a 'message block contact' log entry. Click 'Unblock the contact' and check that there is a 'message unblock contact' log entry. Send the user a message and check that there is a 'message write' log entry. Remove the contact and check that there is a 'message remove contact' log entry.
    • Affected Branches:
      MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE
    • Pull Master Branch:
      MDL-40913_master
    • Story Points:
      20
    • Sprint:
      BACKEND Sprint 11

      Description

      Replace the add_to_log calls for the following area, with a call to the get_legacy_logdata function in the event class.

      message
      /message/index.php:134: add_to_log(SITEID, 'message', 'add contact', 'index.php?user1='.$addcontact.'&user2='.$USER->id, $addcontact);
      /message/index.php:139: add_to_log(SITEID, 'message', 'remove contact', 'index.php?user1='.$removecontact.'&user2='.$USER->id, $removecontact);
      /message/index.php:143: add_to_log(SITEID, 'message', 'block contact', 'index.php?user1='.$blockcontact.'&user2='.$USER->id, $blockcontact);
      /message/index.php:147: add_to_log(SITEID, 'message', 'unblock contact', 'index.php?user1='.$unblockcontact.'&user2='.$USER->id, $unblockcontact);
      /message/index.php:184: add_to_log(SITEID, 'message', 'write', 'index.php?user='.$user1->id.'&id='.$user2->id.'&history=1#m'.$messageid, $user1->id);
      /message/lib.php:132: add_to_log(SITEID, 'message', 'view', 'index.php', $viewing);

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/May/14