Moodle
  1. Moodle
  2. MDL-34901

User's first access value set to lastmodified rather than actual login time

    Details

    • Testing Instructions:
      Hide

      1/ create some new users via CSV
      2/ login as one of those users a few times
      3/ verify lastlogin, firstaccess and lastaccess fields in user table or user profile

      Show
      1/ create some new users via CSV 2/ login as one of those users a few times 3/ verify lastlogin, firstaccess and lastaccess fields in user table or user profile
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w34_MDL-34901_m24_useraccess
    • Rank:
      43427

      Description

      When a user account is created using bulk upload or manually (I haven't checked other methods), their First access and Last access information appears in their profile as "Never". In the database, these values are set to zero. When the user logs in for the first time, rather than taking that time as the first access time, it seems to use the lastmodified time on the user record instead.

      Replication steps:

      1. Log in as admin
      2. Navigate to Settings > Site admin > Users > Accounts > Add a new user
      3. Enter user details and click Update profile - You should be taken to the users list
      4. Click on the new user's name to be take to their profile page - Login should be never
      5. Wait a few minutes at least
      6. In another browser, log in as the new student
      7. As admin, refresh the user's profile page

      Expected result: The First access and Last access values should be the same

      Actual result: The First access time is the time of the account creation (drawn from lastmodified in the DB)

        Issue Links

          Activity

          Hide
          Petr Škoda added a comment -

          Thanks for the report.

          Show
          Petr Škoda added a comment - Thanks for the report.
          Hide
          Dan Poltawski added a comment -

          I've integrated this to master, 23 and 22, thanks!

          I'm have a feeling that there will be duplicates of this issue hidden somewhere in the tracker. because I have a strong memory of seeing this issue before. We should probably have a good look to try and find them.

          Show
          Dan Poltawski added a comment - I've integrated this to master, 23 and 22, thanks! I'm have a feeling that there will be duplicates of this issue hidden somewhere in the tracker. because I have a strong memory of seeing this issue before. We should probably have a good look to try and find them.
          Hide
          Michael de Raadt added a comment -

          Test result: Success!

          Tested in 2.2, 2.3 and master.

          Show
          Michael de Raadt added a comment - Test result: Success! Tested in 2.2, 2.3 and master.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          YEAR!*

          CAF*, TOT!*

          • Your effort amazingly resulted. (unbelievable :-P)
          • Closing as fixed.
          • Tons of thanks.
          Show
          Eloy Lafuente (stronk7) added a comment - YEAR!* CAF*, TOT!* Your effort amazingly resulted. (unbelievable :-P) Closing as fixed. Tons of thanks.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: