r112406 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112405‎ | r112406 | r112407 >
Date:17:58, 25 February 2012
Author:jeroendedauw
Status:deferred
Tags:
Comment:
also put an entry in the rev table
Modified paths:
  • /trunk/extensions/EducationProgram/maintenance/importWEPData.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/maintenance/importWEPData.php
@@ -93,6 +93,10 @@
9494 * @param array $orgs Org names as keys. Values get set to the id after insertion.
9595 */
9696 protected function insertOrgs( array &$orgs ) {
 97+ $revAction = new EPRevisionAction();
 98+ $revAction->setUser( $GLOBALS['wgUser'] );
 99+ $revAction->setComment( 'Import' );
 100+
97101 wfGetDB( DB_MASTER )->begin();
98102
99103 foreach ( $orgs as $org => &$id ) {
@@ -104,7 +108,7 @@
105109 true
106110 );
107111
108 - $org->save();
 112+ $org->revisionedSave( $revAction );
109113 $id = $org->getId();
110114 }
111115
@@ -120,6 +124,10 @@
121125 * @return array Inserted courses. keys are names, values are ids
122126 */
123127 protected function insertCourses( array $courses, array $orgs ) {
 128+ $revAction = new EPRevisionAction();
 129+ $revAction->setUser( $GLOBALS['wgUser'] );
 130+ $revAction->setComment( 'Import' );
 131+
124132 $courseIds = array();
125133
126134 foreach ( $courses as $course => $org ) {
@@ -143,7 +151,7 @@
144152 );
145153
146154 try{
147 - $course->save();
 155+ $course->revisionedSave( $revAction );
148156 $courseIds[$name] = $course->getId();
149157 $name = str_replace( '_', ' ', $name );
150158 echo "Inserted course '$name'.\n";

Status & tagging log