When visiting a 'red link' of a deleted file, a deletion and move log excerpt is...
authorTobias <churchofemacs@users.mediawiki.org>
Tue, 20 Apr 2010 20:30:11 +0000 (20:30 +0000)
committerTobias <churchofemacs@users.mediawiki.org>
Tue, 20 Apr 2010 20:30:11 +0000 (20:30 +0000)
RELEASE-NOTES
includes/specials/SpecialUpload.php
languages/messages/MessagesEn.php

index 04c06ba..7d4b282 100644 (file)
@@ -49,6 +49,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Special:Listfiles now supports a username parameter
 * Special:Random carries over query string parameters
 * (bug 23206) Add Special::Search hook for detecting successful "Go"
+* When visiting a "red link" of a deleted file, a deletion and move log excerpt
+  is provided on the Upload form.
 
 === Bug fixes in 1.17 ===
 * (bug 17560) Half-broken deletion moved image files to deletion archive
index c87acee..fa113ff 100644 (file)
@@ -237,6 +237,21 @@ class SpecialUpload extends SpecialPage {
                        $form->addPreText( wfMsgExt( 'session_fail_preview', 'parseinline' ) );
                }
 
+               # Give a notice if the user is uploading a file that has been deleted or moved
+               # Note that this is independent from the message 'filewasdeleted' that requires JS
+               $desiredTitleObj = Title::newFromText( $this->mDesiredDestName, NS_FILE );
+               $delNotice = ''; // empty by default
+               if ( !$desiredTitleObj->exists() ) {
+                       LogEventsList::showLogExtract( &$delNotice, array( 'delete', 'move' ), 
+                               $desiredTitleObj->getPrefixedText(),
+                               '', array( 'lim' => 10,
+                                          'conds' => array( "log_action != 'revision'" ),
+                                          'showIfEmpty' => false,
+                                          'msgKey' => array( 'upload-recreate-warning' ) )
+                       );
+               }
+               $form->addPreText( $delNotice );
+
                # Add text to form
                $form->addPreText( '<div id="uploadtext">' . 
                        wfMsgExt( 'uploadtext', 'parse', array( $this->mDesiredDestName ) ) . 
index a9d700b..5a277a4 100644 (file)
@@ -2019,6 +2019,9 @@ Pages on [[Special:Watchlist|your watchlist]] are '''bold'''.",
 'upload_directory_read_only'  => 'The upload directory ($1) is not writable by the webserver.',
 'uploaderror'                 => 'Upload error',
 'upload-summary'              => '', # do not translate or duplicate this message to other languages
+'upload-recreate-warning'     => "'''Warning: A file by that name has been deleted or moved.'''
+
+The deletion and move log for this page are provided here for convenience:",
 'uploadtext'                  => "Use the form below to upload files.
 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]].