* Removed WebRequest::escapeAppendQuery(). (deprecated since 1.20)
* Removed info(), purge(), revert() and rollback() from the Article class; they
have since become subclasses of the Action class. (deprecated since 1.19)
+* SearchEngineReplacePrefixesComplete hook was removed.
+* Removed HTMLForm::addJS(). (deprecated since 1.18)
==== Renamed classes ====
* CLDRPluralRuleConverter_Expression to CLDRPluralRuleConverterExpression
$term : Search term string
&$title : Current Title object that is being returned (null if none found).
-'SearchEngineReplacePrefixesComplete': Run after SearchEngine::replacePrefixes().
-$searchEngine : The SearchEngine object. Users of this hooks will be interested
-in the $searchEngine->namespaces array.
-$query : Original query.
-&$parsed : Resultant query with the prefixes stripped.
-
'SearchResultInitFromTitle': Set the revision used when displaying a page in
search results.
$title : Current Title object being displayed in search results.
$previewHTML = $parserOutput->getText();
$this->mParserOutput = $parserOutput;
- $wgOut->addParserOutputNoText( $parserOutput );
+ $wgOut->addParserOutputMetadata( $parserOutput );
if ( count( $parserOutput->getWarnings() ) ) {
$note .= "\n\n" . implode( "\n\n", $parserOutput->getWarnings() );
* @param ParserOutput $parserOutput
*/
public function addParserOutputNoText( &$parserOutput ) {
- wfDeprecated( __METHOD__, '1.24' );
$this->addParserOutputMetadata( $parserOutput );
}
if ( isset( $prop['headitems'] ) || isset( $prop['headhtml'] ) ) {
$context = $this->getContext();
$context->setTitle( $titleObj );
- $context->getOutput()->addParserOutputNoText( $p_result );
+ $context->getOutput()->addParserOutputMetadata( $p_result );
if ( isset( $prop['headitems'] ) ) {
$headItems = $this->formatHeadItems( $p_result->getHeadItems() );
ApiBase::PROP_NULLABLE => true
),
'logtype' => array(
- ApiBase::PROP_TYPE => $config->get( 'LogTypes' ),
+ ApiBase::PROP_TYPE => $this->getConfig()->get( 'LogTypes' ),
ApiBase::PROP_NULLABLE => true
),
'logaction' => array(
global $wgLanguageCode, $wgContLang;
- $request = $this->getRequest();
- $user = $this->getUser();
+ try {
+ $request = $this->getRequest();
+ $user = $this->getUser();
- $code = $request->getVal( 'uselang', $user->getOption( 'language' ) );
- $code = self::sanitizeLangCode( $code );
+ $code = $request->getVal( 'uselang', $user->getOption( 'language' ) );
+ $code = self::sanitizeLangCode( $code );
- wfRunHooks( 'UserGetLanguageObject', array( $user, &$code, $this ) );
+ wfRunHooks( 'UserGetLanguageObject', array( $user, &$code, $this ) );
- if ( $code === $wgLanguageCode ) {
- $this->lang = $wgContLang;
- } else {
- $obj = Language::factory( $code );
- $this->lang = $obj;
- }
+ if ( $code === $wgLanguageCode ) {
+ $this->lang = $wgContLang;
+ } else {
+ $obj = Language::factory( $code );
+ $this->lang = $obj;
+ }
- unset( $this->recursion );
+ unset( $this->recursion );
+ }
+ catch ( Exception $ex ) {
+ unset( $this->recursion );
+ throw $ex;
+ }
}
return $this->lang;
return $this->displayFormat === 'vform';
}
- /**
- * Add the HTMLForm-specific JavaScript, if it hasn't been
- * done already.
- * @deprecated since 1.18 load modules with ResourceLoader instead
- */
- static function addJS() {
- wfDeprecated( __METHOD__, '1.18' );
- }
-
/**
* Get the HTMLFormField subclass for this descriptor.
*
} else {
$localLinkTitle = Title::newFromText( $linkValue );
if ( $localLinkTitle !== null ) {
- $link = $localLinkTitle->getLocalURL();
+ $link = $localLinkTitle->getLinkURL();
}
}
break;
$parsed = $query;
if ( strpos( $query, ':' ) === false ) { // nothing to do
- wfRunHooks( 'SearchEngineReplacePrefixesComplete', array( $this, $query, &$parsed ) );
return $parsed;
}
$parsed = $query; // prefix was the whole query
}
- wfRunHooks( 'SearchEngineReplacePrefixesComplete', array( $this, $query, &$parsed ) );
-
return $parsed;
}
$output->showLagWarning( $lag );
}
+ # If no rows to display, show message before try to render the list
+ if ( $rows->numRows() == 0 ) {
+ $output->wrapWikiMsg(
+ "<div class='mw-changeslist-empty'>\n$1\n</div>", 'recentchanges-noresult'
+ );
+ return;
+ }
+
$dbr->dataSeek( $rows, 0 );
$list = ChangesList::newFromContext( $this->getContext() );
}
$s .= $list->endRecentChangesList();
- if ( $rows->numRows() == 0 ) {
- $output->wrapWikiMsg(
- "<div class='mw-changeslist-empty'>\n$1\n</div>", 'recentchanges-noresult'
- );
- } else {
- $output->addHTML( $s );
- }
+ $output->addHTML( $s );
}
/**
!! end
+!! test
+Gallery with link that has fragment
+!! wikitext
+<gallery>
+image:foobar.jpg|link=Main_Page
+image:foobar.jpg|link=Main_Page#section
+image:foobar.jpg|link=Main Page#section|caption
+</gallery>
+!! html
+<ul class="gallery mw-gallery-traditional">
+ <li class="gallerybox" style="width: 155px"><div style="width: 155px">
+ <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/Main_Page"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" /></a></div></div>
+ <div class="gallerytext">
+ </div>
+ </div></li>
+ <li class="gallerybox" style="width: 155px"><div style="width: 155px">
+ <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/Main_Page#section"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" /></a></div></div>
+ <div class="gallerytext">
+ </div>
+ </div></li>
+ <li class="gallerybox" style="width: 155px"><div style="width: 155px">
+ <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/Main_Page#section"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" /></a></div></div>
+ <div class="gallerytext">
+<p>caption
+</p>
+ </div>
+ </div></li>
+</ul>
+
+!! end
+
!! test
Gallery with wikitext inside caption
!! wikitext
*/
public function testFormatComment( $expected, $comment, $title = false, $local = false ) {
$this->setMwGlobals( array(
+ 'wgScript' => '/wiki/index.php',
'wgArticlePath' => '/wiki/$1',
'wgWellFormedXml' => true,
) );