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

Wiki log missed course module id.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.1, 2.1.1
    • Fix Version/s: None
    • Component/s: Wiki (2.x)
    • Labels:
    • Testing Instructions:
      Hide

      You cann't get wiki's log in activity report.

      Show
      You cann't get wiki's log in activity report.
    • Affected Branches:
      MOODLE_21_STABLE

      Description

      It seems that wiki module forget to record cmid to m_log table. When teacher check the report of wiki activity, the total number will be none. I examined m_log table, found all wiki log has cmid=0. It's a very annoying bug. If the course has more than one wiki, it'll be complicated for the administrator to solve this problem in database. I grep wiki's code, found these line called add_to_log function:

      ./edit.php:80:add_to_log($course->id, 'wiki', 'edit', "edit.php?id=$cm->id", "$wiki->id");
      ./view.php:259:add_to_log($course->id, 'wiki', 'view', 'view.php?id=' . $cm->id, $wiki->id);
      ./lock.php:74://add_to_log($course->id, "wiki", "lock", "lock.php?id=$cm->id", "$wiki->id");
      ./map.php:59:add_to_log($course->id, "wiki", "map", "map.php?id=$cm->id", "$wiki->id");
      ./comments.php:62:add_to_log($course->id, 'wiki', 'comments', 'comments.php?id=' . $cm->id, $wiki->id);
      ./index.php:48:add_to_log($course->id, 'wiki', 'view all', "index.php?id=$course->id", "");
      ./diff.php:70:add_to_log($course->id, "wiki", "diff", "diff.php?id=$cm->id", "$wiki->id");
      ./create.php:69:add_to_log($course->id, 'createpage', 'createpage', 'view.php?id=' . $cm->id, $wiki->id);
      ./prettyview.php:59:add_to_log($course->id, "wiki", "view", "prettyview.php?pageid=$pageid", "$wiki->id");
      ./history.php:64:add_to_log($course->id, 'wiki', 'history', 'history.php?id=' . $cm->id, $wiki->id);
      ./viewversion.php:62:add_to_log($course->id, "wiki", "history", "history.php?id=$cm->id", "$wiki->id");
      ./admin.php:61:add_to_log($course->id, "wiki", "admin", "admin.php?id=$cm->id", "$wiki->id");
      ./overridelocks.php:70:add_to_log($course->id, "wiki", "overridelocks", "overridelocks.php?id=$cm->id", "$wiki->id");
      ./restoreversion.php:63:add_to_log($course->id, "restore", "restore", "view.php?id=$cm->id", "$wiki->id");

      I changed all these line to these:

      ./admin.php:add_to_log($course->id, "wiki", "admin", "admin.php?id=$cm->id", "$wiki->id", $cm->id);
      ./view.php:add_to_log($course->id, 'wiki', 'view', 'view.php?id=' . $cm->id, $wiki->id, $cm->id);
      ./overridelocks.php:add_to_log($course->id, "wiki", "overridelocks", "overridelocks.php?id=$cm->id", "$wiki->id", $cm->id);
      ./edit.php:add_to_log($course->id, 'wiki', 'edit', "edit.php?id=$cm->id", "$wiki->id", $cm->id);
      ./comments.php:add_to_log($course->id, 'wiki', 'comments', 'comments.php?id=' . $cm->id, $wiki->id, $cm->id);
      ./map.php:add_to_log($course->id, "wiki", "map", "map.php?id=$cm->id", "$wiki->id", $cm->id);
      ./lock.php://add_to_log($course->id, "wiki", "lock", "lock.php?id=$cm->id", "$wiki->id", $cm->id);
      ./viewversion.php:add_to_log($course->id, "wiki", "history", "history.php?id=$cm->id", "$wiki->id", $cm->id);
      ./restoreversion.php:add_to_log($course->id, "restore", "restore", "view.php?id=$cm->id", "$wiki->id", $cm->id);
      ./diff.php:add_to_log($course->id, "wiki", "diff", "diff.php?id=$cm->id", "$wiki->id", $cm->id);
      ./prettyview.php:add_to_log($course->id, "wiki", "view", "prettyview.php?pageid=$pageid", "$wiki->id", $cm->id);
      ./history.php:add_to_log($course->id, 'wiki', 'history', 'history.php?id=' . $cm->id, $wiki->id, $cm->id);
      ./index.php:add_to_log($course->id, 'wiki', 'view all', "index.php?id=$course->id", "", $cm->id);
      ./create.php:add_to_log($course->id, 'createpage', 'createpage', 'view.php?id=' . $cm->id, $wiki->id, $cm->id);

      I added "$cm->id" argument, and found wiki's log in wiki activity report, but I am not sure whether these change will cause other problem. I wish this bug will be resolved immediately.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                granludo Ludo ( Marc Alier)
                Reporter:
                luyanfei Yanfei Lu
                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:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: