From 34c239655e047b209aa00b955ce321acf4ebaef3 Mon Sep 17 00:00:00 2001 From: Siebrand Date: Wed, 26 Mar 2014 14:07:44 +0000 Subject: [PATCH] Revert "New Hook rc/watchlist hook ChangesListBegin" This reverts commit 01798c3813b602bd3e8f9a666249e6da58526109. The patch set changed a RecentChanges interface used in at least the extension CleanChanges so that it was generating a lot of warnings. Additional parameters to existing methods that are used elsewhere should have defaults to not break backward compatibility. Change-Id: I1851e23e186ba7aaeb001ba212e56888657a3ae0 --- RELEASE-NOTES-1.23 | 2 -- docs/hooks.txt | 10 ---------- includes/changes/ChangesList.php | 3 +-- includes/changes/EnhancedChangesList.php | 6 +----- includes/changes/OldChangesList.php | 11 ----------- includes/specials/SpecialRecentchanges.php | 2 +- includes/specials/SpecialWatchlist.php | 3 +-- 7 files changed, 4 insertions(+), 33 deletions(-) diff --git a/RELEASE-NOTES-1.23 b/RELEASE-NOTES-1.23 index 4e00d40edf..340aa505a4 100644 --- a/RELEASE-NOTES-1.23 +++ b/RELEASE-NOTES-1.23 @@ -130,8 +130,6 @@ production. * 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 diff --git a/docs/hooks.txt b/docs/hooks.txt index 122a89be28..e4037e6a07 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1112,11 +1112,6 @@ $editToken: The user's edit token. &$hookErr: Out-param for the error. Passed as the parameters to OutputPage::showErrorPage. -'EnhancedChangesListBegin': to receive the full list of rows to be rendered -in the enhanced changes list before rendering begings. -$changesList: EnhancedChangesList object -$rows: ResultWrapper containing all rows to be rendered - 'ExemptFromAccountCreationThrottle': Exemption from the account creation throttle. $ip: The ip address of the user @@ -1747,11 +1742,6 @@ displayed. &$transform: whether or not to expand variables and templates in the message (bool) -'OldChangesListBegin': to receive the full list of rows to be rendered -in the enhanced changes list before rendering begings. -$changesList: OldChangesList object -$rows: array containing all rows to be rendered - 'OldChangesListRecentChangesLine': Customize entire recent changes line, or return false to omit the line from RecentChanges and Watchlist special pages. &$changeslist: The OldChangesList instance. diff --git a/includes/changes/ChangesList.php b/includes/changes/ChangesList.php index 511690125e..ca9efc3934 100644 --- a/includes/changes/ChangesList.php +++ b/includes/changes/ChangesList.php @@ -160,10 +160,9 @@ class ChangesList extends ContextSource { /** * Returns text for the start of the tabular part of RC - * @param ResultWrapper|array $rows * @return string */ - public function beginRecentChangesList( $rows ) { + public function beginRecentChangesList() { $this->rc_cache = array(); $this->rcMoveIndex = 0; $this->rcCacheIndex = 0; diff --git a/includes/changes/EnhancedChangesList.php b/includes/changes/EnhancedChangesList.php index de8bf7206d..feb6d7b2bf 100644 --- a/includes/changes/EnhancedChangesList.php +++ b/includes/changes/EnhancedChangesList.php @@ -59,11 +59,9 @@ class EnhancedChangesList extends ChangesList { /** * Add the JavaScript file for enhanced changeslist - * - * @param ResultWrapper $res * @return string */ - public function beginRecentChangesList( $res ) { + public function beginRecentChangesList() { $this->rc_cache = array(); $this->rcMoveIndex = 0; $this->rcCacheIndex = 0; @@ -78,8 +76,6 @@ class EnhancedChangesList extends ChangesList { 'mediawiki.icon', ) ); - wfRunHooks( 'EnhancedChangesListBegin', array( $this, $res ) ); - return '
'; } diff --git a/includes/changes/OldChangesList.php b/includes/changes/OldChangesList.php index d88e99a0a6..458f21a139 100644 --- a/includes/changes/OldChangesList.php +++ b/includes/changes/OldChangesList.php @@ -130,15 +130,4 @@ class OldChangesList extends ChangesList { return "$dateheader
  • " . $s . "
  • \n"; } - - /** - * Returns text for the start of the tabular part of RC - * - * @param ResultWrapper $res - * @return string - */ - public function beginRecentChangesList( $res ) { - wfRunHooks( 'OldChangesListBegin', array( $this, $res ) ); - return parent::beginRecentChangesList( $res ); - } } diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index 885e4cfdbe..720d0a80f8 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -295,7 +295,7 @@ class SpecialRecentChanges extends ChangesListSpecialPage { $counter = 1; $list = ChangesList::newFromContext( $this->getContext() ); - $rclistOutput = $list->beginRecentChangesList( $rows ); + $rclistOutput = $list->beginRecentChangesList(); foreach ( $rows as $obj ) { if ( $limit == 0 ) { break; diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index 7c3002ddf3..4c3f17bb98 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -317,8 +317,7 @@ class SpecialWatchlist extends ChangesListSpecialPage { $list = ChangesList::newFromContext( $this->getContext() ); $list->setWatchlistDivs(); - $s = $list->beginRecentChangesList( $rows ); - $dbr->dataSeek( $rows, 0 ); + $s = $list->beginRecentChangesList(); $counter = 1; foreach ( $rows as $obj ) { # Make RC entry -- 2.20.1