(Also, replace wfMsg() with wfMsgForContent() for the unknown_extension_tag message.)
* (bug 16160) Suggestions box should be resized from left for RTL wikis
* (bug 11533) Fixed insane slowdown when in read-only mode for long periods
of time with CACHE_NONE (default objectcache table configuration).
* (bug 16160) Suggestions box should be resized from left for RTL wikis
* (bug 11533) Fixed insane slowdown when in read-only mode for long periods
of time with CACHE_NONE (default objectcache table configuration).
+* Trying to set two different default category sort keys for one page now produces
+ a warning
=== API changes in 1.14 ===
=== API changes in 1.14 ===
public static function defaultsort( $parser, $text ) {
$text = trim( $text );
public static function defaultsort( $parser, $text ) {
$text = trim( $text );
- if( strlen( $text ) > 0 )
- $parser->setDefaultSort( $text );
- return '';
+ if( strlen( $text ) == 0 )
+ return '';
+ $old = $parser->getCustomDefaultSort();
+ $parser->setDefaultSort( $text );
+ if( $old === false || $old == $text )
+ return '';
+ else
+ return( '<span class="error">' .
+ wfMsgForContent( 'duplicate_defaultsort',
+ htmlspecialchars( $old ),
+ htmlspecialchars( $text ) ) .
+ '</span>' );
}
public static function filepath( $parser, $name='', $option='' ) {
}
public static function filepath( $parser, $name='', $option='' ) {
$stripList = $parser->getStripList();
if ( !in_array( $tagName, $stripList ) ) {
return '<span class="error">' .
$stripList = $parser->getStripList();
if ( !in_array( $tagName, $stripList ) ) {
return '<span class="error">' .
- wfMsg( 'unknown_extension_tag', $tagName ) .
+ wfMsgForContent( 'unknown_extension_tag', $tagName ) .
+ /**
+ * Accessor for $mDefaultSort
+ * Unlike getDefaultSort(), will return false if none is set
+ *
+ * @return string or false
+ */
+ public function getCustomDefaultSort() {
+ return $this->mDefaultSort;
+ }
+
/**
* Try to guess the section anchor name based on a wikitext fragment
* presumably extracted from a heading, for example "Header" from
/**
* Try to guess the section anchor name based on a wikitext fragment
* presumably extracted from a heading, for example "Header" from
# Core parser functions
'unknown_extension_tag' => 'Unknown extension tag "$1"',
# Core parser functions
'unknown_extension_tag' => 'Unknown extension tag "$1"',
+'duplicate_defaultsort' => 'Warning: Default sort key "$2" overrides earlier default sort key "$1".',
# Special:Version
'version' => 'Version', # Not used as normal message but as header for the special page itself
# Special:Version
'version' => 'Version', # Not used as normal message but as header for the special page itself