Merge "New Hook rc/watchlist hook ChangesListBegin"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 26 Mar 2014 11:55:13 +0000 (11:55 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 26 Mar 2014 11:55:13 +0000 (11:55 +0000)
1  2 
RELEASE-NOTES-1.23
includes/specials/SpecialRecentchanges.php
includes/specials/SpecialWatchlist.php

diff --combined RELEASE-NOTES-1.23
@@@ -50,7 -50,6 +50,7 @@@ production
    prepended to the start of this array.
  * $wgQueryPages has been removed. Query Pages should be added to by using the
    wgQueryPages hook.
 +* $wgHttpOnlyBlacklist has been removed.
  
  === New features in 1.23 ===
  * ResourceLoader can utilize the Web Storage API to cache modules client-side.
  * Added BaseTemplateAfterPortlet hook to allow injecting html after portlets in skins.
  * Support has been added for a JSON based localisation file format. The
    installer has been updated to use it.
+ * Add new hooks OldChangesListBegin and EnhancedChangesListBegin hooks to allow
+   extensions a chance to batch process the result set prior to rendering.
  
  === Bug fixes in 1.23 ===
  * (bug 41759) The "updated since last visit" markers (on history pages, recent
@@@ -45,7 -45,6 +45,7 @@@ class SpecialRecentChanges extends Chan
                        $query = $this->getFeedQuery();
                        $query['feedformat'] = $feedFormat === 'atom' ? 'atom' : 'rss';
                        $this->getOutput()->redirect( wfAppendQuery( wfScript( 'api' ), $query ) );
 +
                        return;
                }
  
                if ( $query['limit'] > $wgFeedLimit ) {
                        $query['limit'] = $wgFeedLimit;
                }
 +
                return $query;
        }
  
                $counter = 1;
                $list = ChangesList::newFromContext( $this->getContext() );
  
-               $rclistOutput = $list->beginRecentChangesList();
+               $rclistOutput = $list->beginRecentChangesList( $rows );
                foreach ( $rows as $obj ) {
                        if ( $limit == 0 ) {
                                break;
        public function checkLastModified() {
                $dbr = $this->getDB();
                $lastmod = $dbr->selectField( 'recentchanges', 'MAX(rc_timestamp)', false, __METHOD__ );
 +
                return $lastmod;
        }
  
@@@ -58,7 -58,6 +58,7 @@@ class SpecialWatchlist extends ChangesL
                        }
  
                        $output->redirect( $title->getLocalURL() );
 +
                        return;
                }
  
                $user = $this->getUser();
                $opts = $this->getOptions();
  
 -              if ( ( $wgEnotifWatchlist || $wgShowUpdatedMarker ) && $request->getVal( 'reset' ) &&
 -                      $request->wasPosted() )
 -              {
 +              if ( ( $wgEnotifWatchlist || $wgShowUpdatedMarker )
 +                      && $request->getVal( 'reset' )
 +                      && $request->wasPosted()
 +              ) {
                        $user->clearAllNotifications();
                        $output->redirect( $this->getPageTitle()->getFullURL( $opts->getChangedValues() ) );
 +
                        return;
                }
  
                // methods defined on WebRequest and removing this dependency would cause some code duplication.
                $request = new DerivativeRequest( $this->getRequest(), $params );
                $opts->fetchValuesFromRequest( $request );
 +
                return $opts;
        }
  
                $list = ChangesList::newFromContext( $this->getContext() );
                $list->setWatchlistDivs();
  
-               $s = $list->beginRecentChangesList();
+               $s = $list->beginRecentChangesList( $rows );
+               $dbr->dataSeek( $rows, 0 );
                $counter = 1;
                foreach ( $rows as $obj ) {
                        # Make RC entry
                if ( $opts['days'] > 0 ) {
                        $timestamp = wfTimestampNow();
                        $wlInfo = $this->msg( 'wlnote2' )->numParams( round( $opts['days'] * 24 ) )->params(
 -                              $lang->userDate( $timestamp, $user ), $lang->userTime( $timestamp, $user ) )->parse() . "<br />\n";
 +                              $lang->userDate( $timestamp, $user ), $lang->userTime( $timestamp, $user )
 +                      )->parse() . "<br />\n";
                }
  
                $nondefaults = $opts->getChangedValues();
                foreach ( $days as $d ) {
                        $days[$i++] = $this->daysLink( $d, $options );
                }
 +
                return $this->msg( 'wlshowlast' )->rawParams(
                        $this->getLanguage()->pipeList( $hours ),
                        $this->getLanguage()->pipeList( $days ),