r86511 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86510‎ | r86511 | r86512 >
Date:17:37, 20 April 2011
Author:siebrand
Status:deferred (Comments)
Tags:
Comment:
Changes for deprecated ParserOptions::getSkin() from r85296 and keeping backward compat with 1.17 (ref: r85246).
Modified paths:
  • /trunk/extensions/Translate/tag/PageTranslationHooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/tag/PageTranslationHooks.php
@@ -210,12 +210,14 @@
211211
212212 $options = $parser->getOptions();
213213
214 - $sk = $options->getSkin();
 214+ // Backward compat for MediaWiki 1.17
215215 if ( method_exists( $options, 'getUserLang' ) ) {
216216 $userLangCode = $options->getUserLang();
 217+ $sk = $options->getSkin();
217218 } else {
218219 global $wgLang;
219220 $userLangCode = $wgLang->getCode();
 221+ $sk = false;
220222 }
221223
222224 $languages = array();
@@ -247,9 +249,19 @@
248250 if ( $parser->getTitle()->getText() === $_title->getText() ) {
249251 $languages[] = Html::rawElement( 'b', null, "*$name* $percent" );
250252 } elseif ( $code === $userLangCode ) {
251 - $languages[] = $sk->linkKnown( $_title, Html::rawElement( 'b', null, "$name $percent" ) );
 253+ // Backward compat for MediaWiki 1.17
 254+ if( $sk ) {
 255+ $languages[] = $sk->linkKnown( $_title, Html::rawElement( 'b', null, "$name $percent" ) );
 256+ } else {
 257+ $languages[] = Linker::linkKnown( $_title, Html::rawElement( 'b', null, "$name $percent" ) );
 258+ }
252259 } else {
253 - $languages[] = $sk->linkKnown( $_title, "$name $percent" );
 260+ // Backward compat for MediaWiki 1.17
 261+ if( $sk ) {
 262+ $languages[] = $sk->linkKnown( $_title, "$name $percent" );
 263+ } else {
 264+ $languages[] = Linker::linkKnown( $_title, "$name $percent" );
 265+ }
254266 }
255267 }
256268

Follow-up revisions

RevisionCommit summaryAuthorDate
r86514Swap incorrect backward compat fix from r86511.siebrand17:57, 20 April 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r85246adding renew-cookies action to the front end (stable enough), version bump to...krinkle11:58, 3 April 2011
r85296Add a getSkin that returns a dummy linker for BC with extensions still abusin...dantman23:32, 3 April 2011

Comments

#Comment by Krinkle (talk | contribs)   20:02, 20 April 2011

How is this related to r85246 ? I assume you meant another rev ?

Status & tagging log