Index: trunk/extensions/EducationProgram/specials/SpecialEnroll.php |
— | — | @@ -235,7 +235,7 @@ |
236 | 236 | ); |
237 | 237 | |
238 | 238 | if ( !$hadStudent ) { |
239 | | - $student = new EPStudent( array( 'user_id' => $this->getUser()->getId() ), true ); |
| 239 | + $student = EPStudents::singleton()->newFromArray( array( 'user_id' => $this->getUser()->getId() ), true ); |
240 | 240 | $fields['first_enroll'] = wfTimestamp( TS_MW ); |
241 | 241 | } |
242 | 242 | |
Index: trunk/extensions/EducationProgram/includes/EPRoleObject.php |
— | — | @@ -53,7 +53,14 @@ |
54 | 54 | $table = $class::singleton(); |
55 | 55 | |
56 | 56 | $userRole = $table->selectRow( $fields, $data ); |
57 | | - return $userRole === false ? new static( $table, $data, true ) : $userRole; |
| 57 | + |
| 58 | + if ( $userRole === false ) { |
| 59 | + return new static( $table, $data, true ); |
| 60 | + } |
| 61 | + else { |
| 62 | + $userRole->setFields( $data ); |
| 63 | + return $userRole; |
| 64 | + } |
58 | 65 | } |
59 | 66 | |
60 | 67 | /** |
— | — | @@ -142,7 +149,7 @@ |
143 | 150 | foreach ( $courses as /* EPCourse */ $course ) { |
144 | 151 | $courseIds[] = $course->getId(); |
145 | 152 | $course->setUpdateSummaries( false ); |
146 | | - $success = $course->enlistUsers( $this->loadAndGetField( 'user_id' ), $this->getRoleName() ) && $success; |
| 153 | + $success = $course->enlistUsers( $this->getField( 'user_id' ), $this->getRoleName() ) && $success; |
147 | 154 | $course->setUpdateSummaries( true ); |
148 | 155 | } |
149 | 156 | |