behavior of several other features where (bogus) section edit links will
disappear, such as file description pages loaded via $wgUseInstantCommons or
pages transcluded cross-wiki via $wgEnableScaryTranscluding.
+* (bug 56912) Show correct link color on cached result of Special:DeadendPages.
=== API changes in 1.23 ===
* (bug 54884) action=parse&prop=categories now indicates hidden and missing
* @ingroup SpecialPage
*/
abstract class PageQueryPage extends QueryPage {
+ /**
+ * Run a LinkBatch to pre-cache LinkCache information,
+ * like page existence and information for stub color and redirect hints.
+ * This should be done for live data and cached data.
+ *
+ * @param $db DatabaseBase connection
+ * @param ResultWrapper $res
+ */
+ public function preprocessResults( $db, $res ) {
+ if ( !$res->numRows() ) {
+ return;
+ }
+
+ $batch = new LinkBatch();
+ foreach ( $res as $row ) {
+ $batch->add( $row->namespace, $row->title );
+ }
+ $batch->execute();
+
+ $res->seek( 0 );
+ }
+
/**
* Format the result as a simple link to the page
*
if ( $title instanceof Title ) {
$text = $wgContLang->convert( $title->getPrefixedText() );
- return Linker::linkKnown( $title, htmlspecialchars( $text ) );
+ return Linker::link( $title, htmlspecialchars( $text ) );
} else {
return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ),
Linker::getInvalidTitleDescription( $this->getContext(), $row->namespace, $row->title ) );
public function show() {
$special = SpecialPageFactory::getPage( 'Revisiondelete' );
$special->setContext( $this->getContext() );
+ $special->getContext()->setTitle( $special->getTitle() );
$special->run( '' );
}
}
class ApiImageRotate extends ApiBase {
private $mPageSet = null;
- public function __construct( $main, $action ) {
- parent::__construct( $main, $action );
- }
-
/**
* Add all items from $values into the result
* @param array $result output
/**
* Diff this content object with another content object.
*
- * @since 1.21diff
+ * @since 1.21
*
* @param $that Content: The other content object to compare this content
* object to.
* @param $lang Language: The language object to use for text segmentation.
* If not given, $wgContentLang is used.
*
- * @return DiffResult: A diff representing the changes that would have to be
+ * @return Diff A diff representing the changes that would have to be
* made to this content object to make it equal to $that.
*/
public function diff( Content $that, Language $lang = null ) {
}
$otext = $this->getNativeData();
- $ntext = $this->getNativeData();
+ $ntext = $that->getNativeData();
# Note: Use native PHP diff, external engines don't give us abstract output
$ota = explode( "\n", $lang->segmentForDiff( $otext ) );
protected function showConvenienceLinks() {
# Give a link to the logs/hist for this page
if ( $this->targetObj ) {
+ // Also set header tabs to be for the target.
+ $this->getSkin()->setRelevantTitle( $this->targetObj );
+
$links = array();
$links[] = Linker::linkKnown(
SpecialPage::getTitleFor( 'Log' ),