r77340 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77339‎ | r77340 | r77341 >
Date:19:09, 26 November 2010
Author:reedy
Status:ok
Tags:
Comment:
Fix Xml::Html from r75646/Bug 26114 - When clicking Category Tree at Special Pages an error occurs
Modified paths:
  • /trunk/extensions/CategoryTree/CategoryTreePage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CategoryTree/CategoryTreePage.php
@@ -29,8 +29,11 @@
3030 function getOption( $name ) {
3131 global $wgCategoryTreeDefaultOptions;
3232
33 - if ( $this->tree ) return $this->tree->getOption( $name );
34 - else return $wgCategoryTreeDefaultOptions[$name];
 33+ if ( $this->tree ) {
 34+ return $this->tree->getOption( $name );
 35+ } else {
 36+ return $wgCategoryTreeDefaultOptions[$name];
 37+ }
3538 }
3639
3740 /**
@@ -48,7 +51,9 @@
4952 $this->target = trim( $this->target );
5053
5154 # HACK for undefined root category
52 - if ( $this->target == '<rootcategory>' || $this->target == '&lt;rootcategory&gt;' ) $this->target = null;
 55+ if ( $this->target == '<rootcategory>' || $this->target == '&lt;rootcategory&gt;' ) {
 56+ $this->target = null;
 57+ }
5358
5459 $options = array();
5560
@@ -109,7 +114,7 @@
110115 $wgOut->addHTML( Xml::openElement( 'form', array( 'name' => 'categorytree', 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-categorytree-form' ) ) );
111116 $wgOut->addHTML( Xml::openElement( 'fieldset' ) );
112117 $wgOut->addHTML( Xml::element( 'legend', null, wfMsgNoTrans( 'categorytree-legend' ) ) );
113 - $wgOut->addHTML( Xml::Html( 'title', $thisTitle->getPrefixedDbKey() ) );
 118+ $wgOut->addHTML( Html::Hidden( 'title', $thisTitle->getPrefixedDbKey() ) );
114119 $wgOut->addHTML( Xml::inputLabel( wfMsgNoTrans( 'categorytree-category' ), 'target', 'target', 20, $this->target ) . ' ' );
115120 $wgOut->addHTML( Xml::openElement( 'select', array( 'name' => 'mode' ) ) );
116121 $wgOut->addHTML( Xml::option( wfMsgNoTrans( 'categorytree-mode-categories' ), 'categories', $mode == CT_MODE_CATEGORIES ? true : false ) );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r75646More deprecated method call removals and updatesreedy15:32, 29 October 2010

Status & tagging log