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

Wrong Last access within a course when the user had never access that course

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 1.8.4, 1.9, 2.0
    • 1.7.2
    • Course
    • None
    • MOODLE_17_STABLE
    • MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE

      When we check within a course the profile of a user who had never access that course we get a wrong 'Last access'. Instead of 'Never', the last access into the course, we get the last access into the site.

      We find a solution modifying the source code in moodle/user/view.php
      In the original code
      if ($course->id != SITEID) {
      if ($lastaccess = get_record('user_lastaccess', 'userid', $user->id, 'courseid', $course->id))

      { $user->lastaccess = $lastaccess->timeaccess; }
      }
      We add a line to take into account when the user never access the course.
      if ($course->id != SITEID) {
      $user->lastaccess = false;
      if ($lastaccess = get_record('user_lastaccess', 'userid', $user->id, 'courseid', $course->id)) { $user->lastaccess = $lastaccess->timeaccess; }

      }

      We test the solution on a 1.7.2 moodle with a 8.2.4 postgres installed in a SUSE Linux Enterprise Server 10 SP1; and a 1.7.2 moodle with a 4.1.22 mysql installed in a SUSE LINUX Enterprise Server 9

            skodak Petr Skoda
            yordonez Yolanda Ordoñez Rufat
            Nobody Nobody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.