r58586 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58585‎ | r58586 | r58587 >
Date:16:30, 5 November 2009
Author:aaron
Status:ok (Comments)
Tags:
Comment:
Holding off r58575 for now
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -60,7 +60,9 @@
6161 */
6262 public static function newFromID( $id ) {
6363 $t = Title::newFromID( $id );
64 - return $t == null ? null : new static( $t );
 64+ # FIXME: doesn't inherit right
 65+ return $t == null ? null : new self( $t );
 66+ #return $t == null ? null : new static( $t ); // PHP 5.3
6567 }
6668
6769 /**

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r58575Make newFromID() inherit correctly (ImagePage/CategoryPage...) by using Late ...aaron08:55, 5 November 2009

Comments

#Comment by Tim Starling (talk | contribs)   00:32, 11 January 2010

You could use

$class = get_class( $this );
return $t == null ? null : new $class( $t );
#Comment by Aaron Schulz (talk | contribs)   02:05, 11 January 2010

newFromID() is static though

#Comment by Tim Starling (talk | contribs)   02:15, 11 January 2010

Duplicating the code would work.

Status & tagging log