Matmarex has uploaded a new change for review.
https://gerrit.wikimedia.org/r/64571
Change subject: Don't reinvent the wheel in
SpecialRecentchangeslinked::getExtraOptions
......................................................................
Don't reinvent the wheel in SpecialRecentchangeslinked::getExtraOptions
Just call parent::getExtraOptions() first and then simply add the one
additional field. The 'SpecialRecentChangesPanel' hook wasn't called
from SpecialRecentchangeslinked previously, I've wrapped the call in
an if to keep the behavior the same.
Changes this causes:
* If $wgAllowCategorizedRecentChanges is true, Recentchangeslinked
will include the category filter form as well.
* The target filter on Recentchangeslinked will be displayed at the
end of the form, below the tag filter.
Change-Id: I4436a63356adb1e0b0daa1aa52c179974a036fa1
---
M includes/specials/SpecialRecentchanges.php
M includes/specials/SpecialRecentchangeslinked.php
2 files changed, 10 insertions(+), 9 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/71/64571/1
diff --git a/includes/specials/SpecialRecentchanges.php
b/includes/specials/SpecialRecentchanges.php
index 0d6378c..ed7acab 100644
--- a/includes/specials/SpecialRecentchanges.php
+++ b/includes/specials/SpecialRecentchanges.php
@@ -677,7 +677,10 @@
$extraOpts['tagfilter'] = $tagFilter;
}
- wfRunHooks( 'SpecialRecentChangesPanel', array( &$extraOpts,
$opts ) );
+ // Don't fire the hook for subclasses. (Or should we?)
+ if ( $this->getName() === 'Recentchanges' ) {
+ wfRunHooks( 'SpecialRecentChangesPanel', array(
&$extraOpts, $opts ) );
+ }
return $extraOpts;
}
diff --git a/includes/specials/SpecialRecentchangeslinked.php
b/includes/specials/SpecialRecentchangeslinked.php
index 062e09d..34250e5 100644
--- a/includes/specials/SpecialRecentchangeslinked.php
+++ b/includes/specials/SpecialRecentchangeslinked.php
@@ -226,21 +226,19 @@
}
/**
- * @param $opts FormOptions
+ * Get options to be displayed in a form
+ *
+ * @param FormOptions $opts
* @return array
*/
function getExtraOptions( $opts ) {
- $opts->consumeValues( array( 'showlinkedto', 'target',
'tagfilter' ) );
- $extraOpts = array();
- $extraOpts['namespace'] = $this->namespaceFilterForm( $opts );
+ $extraOpts = parent::getExtraOptions( $opts );
+
$extraOpts['target'] = array( $this->msg(
'recentchangeslinked-page' )->escaped(),
Xml::input( 'target', 40, str_replace( '_', ' ',
$opts['target'] ) ) .
Xml::check( 'showlinkedto', $opts['showlinkedto'],
array( 'id' => 'showlinkedto' ) ) . ' ' .
Xml::label( $this->msg( 'recentchangeslinked-to'
)->text(), 'showlinkedto' ) );
- $tagFilter = ChangeTags::buildTagFilterSelector(
$opts['tagfilter'] );
- if ( $tagFilter ) {
- $extraOpts['tagfilter'] = $tagFilter;
- }
+
return $extraOpts;
}
--
To view, visit https://gerrit.wikimedia.org/r/64571
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4436a63356adb1e0b0daa1aa52c179974a036fa1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Matmarex <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits