r89571 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89570‎ | r89571 | r89572 >
Date:15:32, 6 June 2011
Author:catrope
Status:ok
Tags:
Comment:
1.17wmf1: MFT r89570
Modified paths:
  • /branches/wmf/1.17wmf1/extensions/WikimediaIncubator/IncubatorTest.php (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/WikimediaIncubator/SpecialViewUserLang.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/extensions/WikimediaIncubator/SpecialViewUserLang.php
@@ -75,11 +75,10 @@
7676 // show error if a user with that name does not exist
7777 $wgOut->addHTML( Xml::span( wfMsg( 'wminc-userdoesnotexist', $target ), 'error' ) );
7878 } else {
79 - $prefix = IncubatorTest::displayPrefix(
80 - $user->getOption( $wmincPref . '-project' ),
81 - $user->getOption( $wmincPref . '-code' )
82 - );
83 - if ( IncubatorTest::isContentProject() ) {
 79+ $userproject = $user->getOption( $wmincPref . '-project' );
 80+ $usercode = $user->getOption( $wmincPref . '-code' );
 81+ $prefix = IncubatorTest::displayPrefix( $userproject, $usercode );
 82+ if ( IncubatorTest::isContentProject( $userproject ) ) {
8483 $testwiki = $sk->link( Title::newFromText( $prefix ) );
8584 } elseif ( $prefix == $wmincProjectSite['short'] ) {
8685 $testwiki = htmlspecialchars( $wmincProjectSite['name'] );
Index: branches/wmf/1.17wmf1/extensions/WikimediaIncubator/IncubatorTest.php
@@ -125,15 +125,16 @@
126126 */
127127 static function displayPrefix( $project = '', $code = '' ) {
128128 global $wgUser, $wmincPref;
129 - if ( ($project && $code) || self::isContentProject() ) {
 129+ $projectvalue = ( $project ? $project : $wgUser->getOption($wmincPref . '-project') );
 130+ $codevalue = ( $code ? $code : $wgUser->getOption($wmincPref . '-code') );
 131+ if ( self::isContentProject( $projectvalue ) ) {
130132 // if parameters are set OR it falls back to user pref and
131133 // he has a content project pref set -> return the prefix
132 - return 'W' . ( $project ? $project : $wgUser->getOption($wmincPref . '-project') ) .
133 - '/' . ( $code ? $code : $wgUser->getOption($wmincPref . '-code') ); // return the prefix
 134+ return 'W' . $projectvalue . '/' . $codevalue; // return the prefix
134135 } else {
135136 // fall back to user pref with NO content pref set
136137 // -> still provide the value (probably 'none' or 'inc')
137 - return $wgUser->getOption($wmincPref . '-project');
 138+ return $projectvalue;
138139 }
139140 }
140141

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r89570Fixing one thing breaks another one.. I hope this doesn't break anything :)robin15:24, 6 June 2011

Status & tagging log