r76526 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76525‎ | r76526 | r76527 >
Date:17:52, 11 November 2010
Author:mah
Status:resolved (Comments)
Tags:
Comment:
* Revert r76503
* Catch exception thrown when user is not logged in SpecialUploadStash.php
* Address RK's fixme comment by making constructor's mimic UnlistedSpecialPage's
Modified paths:
  • /trunk/phase3/includes/specials/SpecialUploadStash.php (modified) (history)
  • /trunk/phase3/includes/upload/UploadStash.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/upload/UploadStash.php
@@ -44,6 +44,10 @@
4545
4646 $this->repo = $repo;
4747
 48+ if ( ! isset( $_SESSION ) ) {
 49+ throw new UploadStashNotAvailableException( 'no session variable' );
 50+ }
 51+
4852 if ( !isset( $_SESSION[UploadBase::SESSION_KEYNAME] ) ) {
4953 $_SESSION[UploadBase::SESSION_KEYNAME] = array();
5054 }
Index: trunk/phase3/includes/specials/SpecialUploadStash.php
@@ -25,10 +25,13 @@
2626
2727 // $request is the request (usually wgRequest)
2828 // $subpage is everything in the URL after Special:UploadStash
29 - // FIXME: These parameters don't match SpecialPage::__construct()'s params at all, and are unused --RK
30 - public function __construct( $request = null, $subpage = null ) {
31 - parent::__construct( 'UploadStash', 'upload' );
32 - $this->stash = new UploadStash();
 29+ public function __construct( $name, $restriction = '', $function = false, $file = 'default' ) {
 30+ parent::__construct( $name, 'upload' );
 31+ try {
 32+ $this->stash = new UploadStash( );
 33+ } catch (UploadStashNotAvailableException $e) {
 34+ return null;
 35+ }
3336 }
3437
3538 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r76537followup r76526...mah19:47, 11 November 2010
r76797uploadwizard-deployment: Merge recent revs from trunk: r75995, r76354, r76386...catrope14:47, 16 November 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r76503fixes Bug 25812mah04:50, 11 November 2010

Comments

#Comment by Catrope (talk | contribs)   19:19, 11 November 2010

Hmm, apparently that didn't work:

<Reedy>	-rakkaus/#mediawiki-i18n- [11-Nov-2010 19:04:50] PHP Warning: Missing argument 1 for SpecialUploadStash::__construct(), called in /www/w/includes/SpecialPage.php on line 404 and defined in /www/w/includes/specials/SpecialUploadStash.php on line 28

It seems Neil and I were both wrong, and SpecialPage subclasses should have a parameterless constructor.

Status & tagging log