Merge "+Test for Status->CleanParams with a callback"
[lhc/web/wiklou.git] / includes / QueryPage.php
index ff505b1..654b616 100644 (file)
@@ -300,8 +300,6 @@ abstract class QueryPage extends SpecialPage {
                }
 
                try {
-                       # Clear out any old cached data
-                       $dbw->delete( 'querycache', array( 'qc_type' => $this->getName() ), $fname );
                        # Do query
                        $res = $this->reallyDoQuery( $limit, false );
                        $num = false;
@@ -327,6 +325,9 @@ abstract class QueryPage extends SpecialPage {
                                                        'qc_value' => $value );
                                }
 
+                               $dbw->begin( __METHOD__ );
+                               # Clear out any old cached data
+                               $dbw->delete( 'querycache', array( 'qc_type' => $this->getName() ), $fname );
                                # Save results into the querycache table on the master
                                if ( count( $vals ) ) {
                                        $dbw->insert( 'querycache', $vals, __METHOD__ );
@@ -336,6 +337,7 @@ abstract class QueryPage extends SpecialPage {
                                $dbw->insert( 'querycache_info',
                                        array( 'qci_type' => $this->getName(), 'qci_timestamp' => $dbw->timestamp() ),
                                        $fname );
+                               $dbw->commit( __METHOD__ );
                        }
                } catch ( DBError $e ) {
                        if ( !$ignoreErrors ) {
@@ -464,7 +466,7 @@ abstract class QueryPage extends SpecialPage {
        /**
         * This is the actual workhorse. It does everything needed to make a
         * real, honest-to-gosh query page.
-        * @para $par
+        * @param string $par
         * @return int
         */
        function execute( $par ) {
@@ -545,7 +547,7 @@ abstract class QueryPage extends SpecialPage {
                                        min( $this->numRows, $this->limit ), # do not show the one extra row, if exist
                                        $this->offset + 1 )->parseAsBlock() );
                                # Disable the "next" link when we reach the end
-                               $paging = $this->getLanguage()->viewPrevNext( $this->getTitle( $par ), $this->offset,
+                               $paging = $this->getLanguage()->viewPrevNext( $this->getPageTitle( $par ), $this->offset,
                                        $this->limit, $this->linkParameters(), ( $this->numRows <= $this->limit ) );
                                $out->addHTML( '<p>' . $paging . '</p>' );
                        } else {
@@ -747,7 +749,7 @@ abstract class QueryPage extends SpecialPage {
        }
 
        function feedUrl() {
-               return $this->getTitle()->getFullURL();
+               return $this->getPageTitle()->getFullURL();
        }
 }