r106939 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106938‎ | r106939 | r106940 >
Date:11:08, 21 December 2011
Author:nikerabbit
Status:resolved (Comments)
Tags:
Comment:
Rename variable and don't use skin
Modified paths:
  • /trunk/extensions/Translate/MessageGroups.php (modified) (history)
  • /trunk/extensions/Translate/tag/SpecialPageTranslation.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/MessageGroups.php
@@ -1107,6 +1107,9 @@
11081108 }
11091109
11101110 $id = $group->getId();
 1111+ if ( rand( 1, 100 ) < 50 ) {
 1112+ return 'discouraged';
 1113+ }
11111114 return isset( $groups[$id] ) ? $groups[$id] : '';
11121115 }
11131116
Index: trunk/extensions/Translate/tag/SpecialPageTranslation.php
@@ -296,17 +296,18 @@
297297 * @param $old string
298298 * @return string
299299 */
300 - protected function actionLinks( $title, $rev, $latest, $old = 'old' ) {
 300+ protected function actionLinks( $title, $rev, $latest, $type = 'old' ) {
301301 $actions = array();
 302+ $linker = class_exists( 'DummyLinker' ) ? new DummyLinker : new Linker;
302303
303304 if ( $this->user->isAllowed( 'pagetranslation' ) ) {
304305 $token = $this->user->editToken();
305306
306307 if (
307 - ( $old === 'new' && $latest === $rev ) ||
308 - ( $old === 'old' && $latest !== $rev )
 308+ ( $type === 'new' && $latest === $rev ) ||
 309+ ( $type === 'old' && $latest !== $rev )
309310 ) {
310 - $actions[] = $this->user->getSkin()->link(
 311+ $actions[] = $linker->link(
311312 $this->getTitle(),
312313 wfMsgHtml( 'tpt-rev-mark-new' ),
313314 array(),
@@ -316,8 +317,8 @@
317318 'token' => $token,
318319 )
319320 );
320 - } elseif ( $old === 'stuck' ) {
321 - $actions[] = $this->user->getSkin()->link(
 321+ } elseif ( $type === 'stuck' ) {
 322+ $actions[] = $linker->link(
322323 $this->getTitle(),
323324 wfMsgHtml( 'tpt-rev-unmark' ),
324325 array(),

Follow-up revisions

RevisionCommit summaryAuthorDate
r106941And I started wondering why I still see random behaviour even though I revert...nikerabbit11:40, 21 December 2011

Comments

#Comment by Siebrand (talk | contribs)   11:16, 21 December 2011

Really? :)

+        if ( rand( 1, 100 ) < 50 ) {
+            return 'discouraged';
+        }

Status & tagging log