Fixed extension function parameter passing
[lhc/web/wiklou.git] / includes / LinksUpdate.php
index 617b2f9..30b1b50 100644 (file)
@@ -33,8 +33,13 @@ class LinksUpdate {
         */
        
        function doUpdate() {
-               global $wgUseBetterLinksUpdate, $wgLinkCache, $wgDBtransactions;
-               global $wgEnablePersistentLC, $wgUseCategoryMagic;
+               global $wgUseDumbLinkUpdate, $wgLinkCache, $wgDBtransactions;
+               global $wgUseCategoryMagic;
+
+               if ( $wgUseDumbLinkUpdate ) {
+                       $this->doDumbUpdate();
+                       return;
+               }
 
                $fname = 'LinksUpdate::doUpdate';
                wfProfileIn( $fname );
@@ -55,15 +60,17 @@ class LinksUpdate {
                        if ( count( $del ) ) {
                                $batch = new LinkBatch( $del );
                                $set = $batch->constructSet( 'pl', $dbw );
-                               $sql = "DELETE FROM $pagelinks WHERE pl_from={$this->mId} AND ($set)";
-                               $dbw->query( $sql, $fname );
+                               if ( $set ) {
+                                       $sql = "DELETE FROM $pagelinks WHERE pl_from={$this->mId} AND ($set)";
+                                       $dbw->query( $sql, $fname );
+                               }
                        }
                } else {
                        # Delete everything
                        $dbw->delete( 'pagelinks', array( 'pl_from' => $this->mId ), $fname );
                                                
                        # Get the addition list
-                       $add = $wgLinkCache->getGoodLinks();
+                       $add = $wgLinkCache->getPageLinks();
                }
 
                # Do the insertion
@@ -201,7 +208,7 @@ class LinksUpdate {
                                array_push( $arr, array(
                                        'pl_from'      => $this->mId,
                                        'pl_namespace' => $target->getNamespace(),
-                                       'pl_title'     => $target->getTitle() ) );
+                                       'pl_title'     => $target->getDBkey() ) );
                        }
                        $dbw->insert( 'pagelinks', $arr, $fname, array( 'IGNORE' ) );
                }