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

If unable to find mapping set log values to \core\event\base::NOT_FOUND

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Minor
    • 3.0
    • 3.0
    • Logging
    • MOODLE_30_STABLE
    • MOODLE_30_STABLE
    • MDL-51781_master
    • Hide
      1. Make sure debugging is on your site. (Site administration > Development > Debugging).
      2. Enable standard logging (Site administration > Plugins > Logging).
      3. Create a course.
      4. Create a forum.
      5. Create a discussion.
      6. Create a reply to this discussion.
      7. Delete the reply.
      8. Delete the discussion.
      9. Create a new discussion.
      10. Create a reply to this discussion.
      11. Backup the course and make sure to include course logs.
      12. Restore as a new course.
      13. Check your 'mdl_logstore_standard_log' table for the new restore records and confirm that for the discussion_deleted events the 'objectid' value is '-31338'.
      14. For the post_deleted events check the other value and confirm the 'discussionid' is set to '-31338'.
      15. Confirm other events related to deleted items contain '-31338' and the ones that can be mapped are.
      Show
      Make sure debugging is on your site. (Site administration > Development > Debugging). Enable standard logging (Site administration > Plugins > Logging). Create a course. Create a forum. Create a discussion. Create a reply to this discussion. Delete the reply. Delete the discussion. Create a new discussion. Create a reply to this discussion. Backup the course and make sure to include course logs. Restore as a new course. Check your 'mdl_logstore_standard_log' table for the new restore records and confirm that for the discussion_deleted events the 'objectid' value is '-31338'. For the post_deleted events check the other value and confirm the 'discussionid' is set to '-31338'. Confirm other events related to deleted items contain '-31338' and the ones that can be mapped are.

    Description

      Currently we only set the value to \core\event\base::NOT_MAPPED if the event explicitly states that the value can not be mapped. However, there may be situations where we can not find the mapping (item has been deleted) so it returns '0' on the call to get_mappingid(), we should also use the \core\event\base::NOT_MAPPED as it doesn't matter whether the event says it can not be mapped, or it actually was not mapped, the result is the same.

      Note - Eloy gave a +1 to this, which is equal to +100 from normal developers.

      Attachments

        Issue Links

          Activity

            People

              markn Mark Nelson
              markn Mark Nelson
              Adrian Greeve Adrian Greeve
              Dan Poltawski Dan Poltawski
              Jun Pataleta Jun Pataleta
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                16/Nov/15