| Index: trunk/phase3/docs/hooks.txt |
| — | — | @@ -1678,10 +1678,13 @@ |
| 1679 | 1679 | $uploadFormTextAfterSummary to inject text (HTML) either before |
| 1680 | 1680 | or after the editform. |
| 1681 | 1681 | |
| 1682 | | -'UploadForm:BeforeProcessing': DEPRECATED! at the beginning of processUpload() |
| | 1682 | +'UploadForm:BeforeProcessing': at the beginning of processUpload() |
| 1683 | 1683 | $form: UploadForm object |
| 1684 | 1684 | Lets you poke at member variables like $mUploadDescription before the |
| 1685 | 1685 | file is saved. |
| | 1686 | +Do not use this hook to break upload processing. This will return the user to |
| | 1687 | +a blank form with no error message; use UploadVerification and |
| | 1688 | +UploadVerifyFile instead |
| 1686 | 1689 | |
| 1687 | 1690 | 'UploadCreateFromRequest': when UploadBase::createFromRequest has been called |
| 1688 | 1691 | $type: (string) the requested upload type |
| Index: trunk/phase3/includes/upload/UploadBase.php |
| — | — | @@ -266,7 +266,6 @@ |
| 267 | 267 | $error = ''; |
| 268 | 268 | if( !wfRunHooks( 'UploadVerification', |
| 269 | 269 | array( $this->mDestName, $this->mTempPath, &$error ) ) ) { |
| 270 | | - // @fixme This status needs another name... |
| 271 | 270 | return array( 'status' => self::HOOK_ABORTED, 'error' => $error ); |
| 272 | 271 | } |
| 273 | 272 | |
| Index: trunk/phase3/includes/specials/SpecialUpload.php |
| — | — | @@ -425,12 +425,13 @@ |
| 426 | 426 | return; |
| 427 | 427 | } |
| 428 | 428 | |
| 429 | | - // Deprecated backwards compatibility hook |
| 430 | 429 | if( !wfRunHooks( 'UploadForm:BeforeProcessing', array( &$this ) ) ) { |
| 431 | 430 | wfDebug( "Hook 'UploadForm:BeforeProcessing' broke processing the file.\n" ); |
| 432 | | - // Return without notifying the user of an error. This sucks, but |
| 433 | | - // this was the previous behaviour as well, and as this hook is |
| 434 | | - // deprecated we're not going to do anything about it. |
| | 431 | + // This code path is deprecated. If you want to break upload processing |
| | 432 | + // do so by hooking into the appropriate hooks in UploadBase::verifyUpload |
| | 433 | + // and UploadBase::verifyFile. |
| | 434 | + // If you use this hook to break uploading, the user will be returned |
| | 435 | + // an empty form with no error message whatsoever. |
| 435 | 436 | return; |
| 436 | 437 | } |
| 437 | 438 | |