r65181 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65180‎ | r65181 | r65182 >
Date:20:47, 17 April 2010
Author:reedy
Status:resolved (Comments)
Tags:
Comment:
Apply my patch for Bug 19155 - Make the selection box for ExtensionDistributor default to the most recent stable version, not trunk
Modified paths:
  • /trunk/extensions/ExtensionDistributor/ExtensionDistributor_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ExtensionDistributor/ExtensionDistributor_body.php
@@ -164,9 +164,13 @@
165165 Xml::element( 'input' , array( 'type' => 'hidden',
166166 'name' => 'extdist_extension', 'value' => $extensionName ) ) .
167167 "<select name=\"extdist_version\">\n" );
 168+
 169+ $selected = 0;
 170+
168171 foreach ( $versions as $branchPath => $branchName ) {
169172 $wgOut->addHTML( Xml::element( 'option',
170 - array( 'value' => $branchPath ), $branchName ) . "\n" );
 173+ array( 'value' => $branchPath, 'selected' => ( ( $selected == 1 ) ? 'selected' : '' ) ), $branchName ) . "\n" );
 174+ $selected++;
171175 }
172176 $wgOut->addHTML(
173177 Xml::closeElement( 'select' ) . ' ' .

Follow-up revisions

RevisionCommit summaryAuthorDate
r65209Followup for r65181reedy11:04, 18 April 2010
r779011.16wmf4: MFT r65181, r65209catrope20:20, 6 December 2010

Comments

#Comment by Nikerabbit (talk | contribs)   20:57, 17 April 2010

Xml::option() and Html::hidden() might help clean up the code.

#Comment by Reedy (talk | contribs)   22:20, 17 April 2010

Will have a poke later :)

#Comment by Reedy (talk | contribs)   10:48, 18 April 2010

$selected = 0;

foreach ( $versions as $branchPath => $branchName ) { $wgOut->addHTML( Xml::option( $branchName, $branchPath, ($selected == 1), array() ) );

$selected++; }

Something like that? Certainly looks more sane!

#Comment by Catrope (talk | contribs)   20:14, 6 December 2010

This loop makes me cringe, but the code looks fine so I'll deploy it anyway.

Status & tagging log