r78868 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78867‎ | r78868 | r78869 >
Date:04:39, 23 December 2010
Author:yaron
Status:deferred
Tags:
Comment:
Fixed backwards-compatibility, added comments
Modified paths:
  • /trunk/extensions/SemanticForms/specials/SF_Templates.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/specials/SF_Templates.php
@@ -21,6 +21,7 @@
2222 $this->setHeaders();
2323 list( $limit, $offset ) = wfCheckLimits();
2424 $rep = new TemplatesPage();
 25+ // execute() method added in MW 1.18
2526 if ( method_exists( $rep, 'execute' ) ) {
2627 $rep->execute( $query );
2728 } else {
@@ -31,7 +32,10 @@
3233
3334 class TemplatesPage extends QueryPage {
3435 public function __construct( $name = 'Templates' ) {
35 - parent::__construct( $name );
 36+ // For MW <= 1.17
 37+ if ( $this instanceof SpecialPage ) {
 38+ parent::__construct( $name );
 39+ }
3640 }
3741
3842 function getName() {
@@ -71,6 +75,7 @@
7276 WHERE page_namespace = {$NStemp}";
7377 }
7478
 79+ // For MW 1.18+
7580 function getQueryInfo() {
7681 return array(
7782 'tables' => array( 'page' ),

Status & tagging log