r49662 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49661‎ | r49662 | r49663 >
Date:14:32, 20 April 2009
Author:demon
Status:ok (Comments)
Tags:
Comment:
Followup to r49493: Tweak this so we only set the title if explicitly asking for it or the Skin's title is null. Make $mTitle protected.
Modified paths:
  • /trunk/phase3/includes/Skin.php (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -2166,11 +2166,13 @@
21672167 $this->mSkin =& Skin::newFromKey( $userSkin );
21682168 wfProfileOut( __METHOD__ );
21692169 }
2170 - if ( !$t ) {
2171 - global $wgOut;
2172 - $t = $wgOut->getTitle();
 2170+ if( $t || !$this->mSkin->getTitle() ) {
 2171+ if ( !$t ) {
 2172+ global $wgOut;
 2173+ $t = $wgOut->getTitle();
 2174+ }
 2175+ $this->mSkin->setTitle( $t );
21732176 }
2174 - $this->mSkin->setTitle( $t );
21752177 return $this->mSkin;
21762178 }
21772179
@@ -3515,4 +3517,4 @@
35163518 return true;
35173519 }
35183520
3519 -}
 3521+}
\ No newline at end of file
Index: trunk/phase3/includes/Skin.php
@@ -24,6 +24,7 @@
2525 /**#@-*/
2626 protected $mRevisionId; // The revision ID we're looking at, null if not applicable.
2727 protected $skinname = 'standard';
 28+ protected $mTitle = null;
2829
2930 /** Constructor, call parent constructor */
3031 function Skin() { parent::__construct(); }
@@ -283,6 +284,11 @@
284285 public function setTitle( $t ) {
285286 $this->mTitle = $t;
286287 }
 288+
 289+ /** Get the title */
 290+ public function getTitle() {
 291+ return $this->mTitle;
 292+ }
287293
288294 function outputPage( OutputPage $out ) {
289295 global $wgDebugComments;
@@ -1920,4 +1926,4 @@
19211927 wfProfileOut( __METHOD__ );
19221928 return $bar;
19231929 }
1924 -}
 1930+}
\ No newline at end of file

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r49493initPage() is far too late to be setting a title, so we'll do it right after ...demon04:43, 15 April 2009

Comments

#Comment by Catrope (talk | contribs)   16:10, 20 April 2009

Fatal error: Cannot access protected property SkinMonoBook::$mTitle in /var/www/wiki115/phase3/extensions/Collection/Collection.hooks.php on line 43

Apparently the Collection extension depends on $mTitle being public

#Comment by Catrope (talk | contribs)   16:21, 20 April 2009

Fixed in r49665

#Comment by Raymond (talk | contribs)   18:48, 20 April 2009

Translatewiki.net

[20-Apr-2009 18:45:35] PHP Fatal error: Cannot access protected property SkinModern::$mTitle in /var/www/w/extensions/Translate/tag/Hooks.php on line 133

#Comment by IAlex (talk | contribs)   16:23, 21 April 2009

fixed in r49672.

Status & tagging log