Issue Details (XML | Word | Printable)

Key: MDL-14395
Type: Bug Bug
Status: Resolved Resolved
Resolution: Duplicate
Priority: Critical Critical
Assignee: Martin Dougiamas
Reporter: N Hansen
Votes: 0
Watchers: 0
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Upgrading to roles loses timestart and timeend from user_students and user_teacher tables

Created: 17/Apr/08 05:37 AM   Updated: 18/Apr/08 11:09 AM
Return to search
Component/s: Enrolments
Affects Version/s: 1.7.3, 1.7.4, 1.8, 1.9
Fix Version/s: 1.7.5, 1.8.6, 1.9.1

Issue Links:
Dependency
 
Duplicate
 
Relates
 

Database: MySQL
Participants: Martin Dougiamas and N Hansen
Security Level: None
Resolved date: 18/Apr/08
Affected Branches: MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE
Fixed Branches: MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE


 Description  « Hide
I have courses where people are allowed to enroll for 180 days. After upgrading from 1.6.5 to 1.73, all information about when they enrolled was lost, along with the dates that they were supposed to be unenrolled. All this information was replaced with 0 in the database.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
N Hansen added a comment - 17/Apr/08 11:33 AM
This sounds similar so I thought I would link it in case it has some bearing on solving this one.

N Hansen added a comment - 18/Apr/08 08:55 AM
In addition, I have tried adding a new student manually to the course. Now, no information is added about when the student was enrolled, or when they will be unenrolled. It still is 0 and shows up as unlimited!

Martin Dougiamas added a comment - 18/Apr/08 11:06 AM
Hmm, whoah, yes they are lost!

lib/accesslib.php

/// Upgrade students.
if (in_array($CFG->prefix.'user_students', $dbtables)) {
if ($rs = get_recordset('user_students')) {
while ($student = rs_fetch_next_record($rs)) { // populate the user_lastaccess table $access = new object; $access->timeaccess = $student->timeaccess; $access->userid = $student->userid; $access->courseid = $student->course; insert_record('user_lastaccess', $access); // assign the default student role $coursecontext = get_context_instance(CONTEXT_COURSE, $student->course); role_assign($studentrole, $student->userid, 0, $coursecontext->id); $progresscount++; print_progress($progresscount, $totalcount, 5, 1, 'Processing role assignments'); }
rs_close($rs);
}
}


Martin Dougiamas added a comment - 18/Apr/08 11:07 AM
Petr can you please look into this please?

Martin Dougiamas added a comment - 18/Apr/08 11:09 AM
Ah, just saw MDL-11142.