https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112406

Revision: 112406
Author:   jeroendedauw
Date:     2012-02-25 17:58:18 +0000 (Sat, 25 Feb 2012)
Log Message:
-----------
also put an entry in the rev table

Modified Paths:
--------------
    trunk/extensions/EducationProgram/maintenance/importWEPData.php

Modified: trunk/extensions/EducationProgram/maintenance/importWEPData.php
===================================================================
--- trunk/extensions/EducationProgram/maintenance/importWEPData.php     
2012-02-25 17:42:55 UTC (rev 112405)
+++ trunk/extensions/EducationProgram/maintenance/importWEPData.php     
2012-02-25 17:58:18 UTC (rev 112406)
@@ -93,6 +93,10 @@
         * @param array $orgs Org names as keys. Values get set to the id after 
insertion.
         */
        protected function insertOrgs( array &$orgs ) {
+               $revAction = new EPRevisionAction();
+               $revAction->setUser( $GLOBALS['wgUser'] );
+               $revAction->setComment( 'Import' );
+               
                wfGetDB( DB_MASTER )->begin();
                
                foreach ( $orgs as $org => &$id ) {
@@ -104,7 +108,7 @@
                                true
                        );
                        
-                       $org->save();
+                       $org->revisionedSave( $revAction );
                        $id = $org->getId();
                }
                
@@ -120,6 +124,10 @@
         * @return array Inserted courses. keys are names, values are ids
         */
        protected function insertCourses( array $courses, array $orgs ) {
+               $revAction = new EPRevisionAction();
+               $revAction->setUser( $GLOBALS['wgUser'] );
+               $revAction->setComment( 'Import' );
+               
                $courseIds = array();
                
                foreach ( $courses as $course => $org ) {
@@ -143,7 +151,7 @@
                        );
                        
                        try{
-                               $course->save();
+                               $course->revisionedSave( $revAction );
                                $courseIds[$name] = $course->getId();
                                $name = str_replace( '_', ' ', $name );
                                echo "Inserted course '$name'.\n";


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to