Index: trunk/phase3/includes/upload/UploadFromStash.php |
— | — | @@ -29,7 +29,12 @@ |
30 | 30 | if( $stash ) { |
31 | 31 | $this->stash = $stash; |
32 | 32 | } else { |
33 | | - wfDebug( __METHOD__ . " creating new UploadStash instance for " . $user->getId() . "\n" ); |
| 33 | + if( $user ) { |
| 34 | + wfDebug( __METHOD__ . " creating new UploadStash instance for " . $user->getId() . "\n" ); |
| 35 | + } else { |
| 36 | + wfDebug( __METHOD__ . " creating new UploadStash instance with no user\n" ); |
| 37 | + } |
| 38 | + |
34 | 39 | $this->stash = new UploadStash( $this->repo, $this->user ); |
35 | 40 | } |
36 | 41 | |
— | — | @@ -100,13 +105,13 @@ |
101 | 106 | } |
102 | 107 | |
103 | 108 | /** |
104 | | - * There is no need to stash the image twice |
| 109 | + * Stash the file. |
105 | 110 | */ |
106 | 111 | public function stashFile() { |
107 | | - if ( $this->mLocalFile ) { |
108 | | - return $this->mLocalFile; |
109 | | - } |
110 | | - return parent::stashFile(); |
| 112 | + // replace mLocalFile with an instance of UploadStashFile, which adds some methods |
| 113 | + // that are useful for stashed files. |
| 114 | + $this->mLocalFile = parent::stashFile(); |
| 115 | + return $this->mLocalFile; |
111 | 116 | } |
112 | 117 | |
113 | 118 | /** |