Index: trunk/phase3/includes/specials/SpecialUpload.php |
— | — | @@ -237,6 +237,21 @@ |
238 | 238 | $form->addPreText( wfMsgExt( 'session_fail_preview', 'parseinline' ) ); |
239 | 239 | } |
240 | 240 | |
| 241 | + # Give a notice if the user is uploading a file that has been deleted or moved |
| 242 | + # Note that this is independent from the message 'filewasdeleted' that requires JS |
| 243 | + $desiredTitleObj = Title::newFromText( $this->mDesiredDestName, NS_FILE ); |
| 244 | + $delNotice = ''; // empty by default |
| 245 | + if ( !$desiredTitleObj->exists() ) { |
| 246 | + LogEventsList::showLogExtract( &$delNotice, array( 'delete', 'move' ), |
| 247 | + $desiredTitleObj->getPrefixedText(), |
| 248 | + '', array( 'lim' => 10, |
| 249 | + 'conds' => array( "log_action != 'revision'" ), |
| 250 | + 'showIfEmpty' => false, |
| 251 | + 'msgKey' => array( 'upload-recreate-warning' ) ) |
| 252 | + ); |
| 253 | + } |
| 254 | + $form->addPreText( $delNotice ); |
| 255 | + |
241 | 256 | # Add text to form |
242 | 257 | $form->addPreText( '<div id="uploadtext">' . |
243 | 258 | wfMsgExt( 'uploadtext', 'parse', array( $this->mDesiredDestName ) ) . |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -2019,6 +2019,9 @@ |
2020 | 2020 | 'upload_directory_read_only' => 'The upload directory ($1) is not writable by the webserver.', |
2021 | 2021 | 'uploaderror' => 'Upload error', |
2022 | 2022 | 'upload-summary' => '', # do not translate or duplicate this message to other languages |
| 2023 | +'upload-recreate-warning' => "'''Warning: A file by that name has been deleted or moved.''' |
| 2024 | + |
| 2025 | +The deletion and move log for this page are provided here for convenience:", |
2023 | 2026 | 'uploadtext' => "Use the form below to upload files. |
2024 | 2027 | To view or search previously uploaded files go to the [[Special:FileList|list of uploaded files]], (re)uploads are also logged in the [[Special:Log/upload|upload log]], deletions in the [[Special:Log/delete|deletion log]]. |
2025 | 2028 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -49,6 +49,8 @@ |
50 | 50 | * Special:Listfiles now supports a username parameter |
51 | 51 | * Special:Random carries over query string parameters |
52 | 52 | * (bug 23206) Add Special::Search hook for detecting successful "Go" |
| 53 | +* When visiting a "red link" of a deleted file, a deletion and move log excerpt |
| 54 | + is provided on the Upload form. |
53 | 55 | |
54 | 56 | === Bug fixes in 1.17 === |
55 | 57 | * (bug 17560) Half-broken deletion moved image files to deletion archive |