r112212 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112211‎ | r112212 | r112213 >
Date:16:04, 23 February 2012
Author:jeroendedauw
Status:deferred
Tags:
Comment:
fix issue not correctly fixed by r112126
Modified paths:
  • /trunk/extensions/EducationProgram/includes/EPRoleObject.php (modified) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialEnroll.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/specials/SpecialEnroll.php
@@ -235,7 +235,7 @@
236236 );
237237
238238 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 );
240240 $fields['first_enroll'] = wfTimestamp( TS_MW );
241241 }
242242
Index: trunk/extensions/EducationProgram/includes/EPRoleObject.php
@@ -53,7 +53,14 @@
5454 $table = $class::singleton();
5555
5656 $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+ }
5865 }
5966
6067 /**
@@ -142,7 +149,7 @@
143150 foreach ( $courses as /* EPCourse */ $course ) {
144151 $courseIds[] = $course->getId();
145152 $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;
147154 $course->setUpdateSummaries( true );
148155 }
149156

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r112126quick fixjeroendedauw18:18, 22 February 2012

Status & tagging log