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

Replace add_to_log with an event trigger - mod_book

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 2.6
    • Component/s: Events API, Logging
    • Labels:
    • Testing Instructions:
      Hide

      For each of the following actions, make sure an entry in mdl_log is made

      1. View the list of all the book activities (mod/book/index.php)
      2. View the book activity
      3. View a specific chapter
      4. Create, update and delete a chapter
      5. Print the entire book
      6. Print a chapter of the book
      7. Export the book as IMSCP package
      8. Import a book (you can use the fixture in mod/book/tool/importhtml/tests/fixtures)
      9. Hide/show a chapter
      10. Move a chapter
      Show
      For each of the following actions, make sure an entry in mdl_log is made View the list of all the book activities (mod/book/index.php) View the book activity View a specific chapter Create, update and delete a chapter Print the entire book Print a chapter of the book Export the book as IMSCP package Import a book (you can use the fixture in mod/book/tool/importhtml/tests/fixtures) Hide/show a chapter Move a chapter
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-40060-master
    • Story Points:
      40
    • Sprint:
      BACKEND Sprint 5

      Description

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

      mod/book (17 calls)
      /mod/book/show.php:67: add_to_log($course->id, 'course', 'update mod', '../mod/book/view.php?id='.$cm->id, 'book '.$book->id);
      /mod/book/show.php:68: add_to_log($course->id, 'book', 'update', 'view.php?id='.$cm->id, $book->id, $cm->id);
      /mod/book/tool/exportimscp/index.php:46: add_to_log($course->id, 'book', 'exportimscp', 'tool/exportimscp/index.php?id='.$cm->id, $book->id, $cm->id);
      /mod/book/tool/importhtml/locallib.php:87: add_to_log($book->course, 'book', 'add chapter', 'view.php?id='.$context->instanceid.'&chapterid='.$chapter->id, $chapter->id, $context->instanceid);
      /mod/book/tool/importhtml/locallib.php:151: add_to_log($book->course, 'course', 'update mod', '../mod/book/view.php?id='.$context->instanceid, 'book '.$book->id);
      /mod/book/tool/print/index.php:80: add_to_log($course->id, 'book', 'print chapter', 'tool/print/index.php?id='.$cm->id.'&chapterid='.$chapter->id, $chapter->id, $cm->id);
      /mod/book/tool/print/index.php:123: add_to_log($course->id, 'book', 'print', 'tool/print/index.php?id='.$cm->id, $book->id, $cm->id);
      /mod/book/index.php:51: add_to_log($course->id, 'book', 'view all', 'index.php?id='.$course->id, '');
      /mod/book/delete.php:71: add_to_log($course->id, 'course', 'update mod', '../mod/book/view.php?id='.$cm->id, 'book '.$book->id);
      /mod/book/delete.php:72: add_to_log($course->id, 'book', 'update', 'view.php?id='.$cm->id, $book->id, $cm->id);
      /mod/book/edit.php:78: add_to_log($course->id, 'course', 'update mod', '../mod/book/view.php?id='.$cm->id, 'book '.$book->id);
      /mod/book/edit.php:79: add_to_log($course->id, 'book', 'update chapter', 'view.php?id='.$cm->id.'&chapterid='.$data->id, $data->id, $cm->id);
      /mod/book/edit.php:104: add_to_log($course->id, 'course', 'update mod', '../mod/book/view.php?id='.$cm->id, 'book '.$book->id);
      /mod/book/edit.php:105: add_to_log($course->id, 'book', 'add chapter', 'view.php?id='.$cm->id.'&chapterid='.$data->id, $data->id, $cm->id);
      /mod/book/move.php:180: add_to_log($course->id, 'course', 'update mod', '../mod/book/view.php?id='.$cm->id, 'book '.$book->id);
      /mod/book/move.php:181: add_to_log($course->id, 'book', 'update', 'view.php?id='.$cm->id, $book->id, $cm->id);
      /mod/book/view.php:78: add_to_log($course->id, 'book', 'view', 'view.php?id='.$cm->id, $book->id, $cm->id);
      /mod/book/view.php:113: add_to_log($course->id, 'book', 'view chapter', 'view.php?id='.$cm->id.'&chapterid='.$chapter->id, $chapter->id, $cm->id);

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  18/Nov/13