Index: trunk/extensions/EducationProgram/maintenance/importWEPData.php |
— | — | @@ -93,6 +93,10 @@ |
94 | 94 | * @param array $orgs Org names as keys. Values get set to the id after insertion. |
95 | 95 | */ |
96 | 96 | protected function insertOrgs( array &$orgs ) { |
| 97 | + $revAction = new EPRevisionAction(); |
| 98 | + $revAction->setUser( $GLOBALS['wgUser'] ); |
| 99 | + $revAction->setComment( 'Import' ); |
| 100 | + |
97 | 101 | wfGetDB( DB_MASTER )->begin(); |
98 | 102 | |
99 | 103 | foreach ( $orgs as $org => &$id ) { |
— | — | @@ -104,7 +108,7 @@ |
105 | 109 | true |
106 | 110 | ); |
107 | 111 | |
108 | | - $org->save(); |
| 112 | + $org->revisionedSave( $revAction ); |
109 | 113 | $id = $org->getId(); |
110 | 114 | } |
111 | 115 | |
— | — | @@ -120,6 +124,10 @@ |
121 | 125 | * @return array Inserted courses. keys are names, values are ids |
122 | 126 | */ |
123 | 127 | protected function insertCourses( array $courses, array $orgs ) { |
| 128 | + $revAction = new EPRevisionAction(); |
| 129 | + $revAction->setUser( $GLOBALS['wgUser'] ); |
| 130 | + $revAction->setComment( 'Import' ); |
| 131 | + |
124 | 132 | $courseIds = array(); |
125 | 133 | |
126 | 134 | foreach ( $courses as $course => $org ) { |
— | — | @@ -143,7 +151,7 @@ |
144 | 152 | ); |
145 | 153 | |
146 | 154 | try{ |
147 | | - $course->save(); |
| 155 | + $course->revisionedSave( $revAction ); |
148 | 156 | $courseIds[$name] = $course->getId(); |
149 | 157 | $name = str_replace( '_', ' ', $name ); |
150 | 158 | echo "Inserted course '$name'.\n"; |