(bug 34863) Make it so an image that was previously deleted and currently does not...
authorBrian Wolff <bawolff@users.mediawiki.org>
Fri, 2 Mar 2012 01:02:41 +0000 (01:02 +0000)
committerBrian Wolff <bawolff@users.mediawiki.org>
Fri, 2 Mar 2012 01:02:41 +0000 (01:02 +0000)
Currently things outside of file namespace display the snippet, so file ns should display snippet for completeness. As far as I can tell, the only reason files don't is because ImagePage class overrides the Article class, and it was unintentional that the snippet was not included in ImagePage class.

RELEASE-NOTES-1.20
includes/ImagePage.php

index d0bceee..1a58fe6 100644 (file)
@@ -37,6 +37,7 @@ production.
 * (bug 34702) Localised parentheses are now used in more special pages.
 * (bug 34723) When editing a script page on a RTL wiki the textbox should be LTR.
 * (bug 34762) Calling close() on a DatabaseBase object now clears the connection.
+* (bug 34863) Show deletion log extract on non-existent file pages if applicable.
 
 === API changes in 1.20 ===
 * (bug 34316) Add ability to retrieve maximum upload size from MediaWiki API.
index 7e72db9..b41e126 100644 (file)
@@ -468,6 +468,22 @@ EOT
                        }
                } else {
                        # Image does not exist
+                       if ( !$this->getID() ) {
+                               # No article exists either
+                               # Show deletion log to be consistent with normal articles
+                               LogEventsList::showLogExtract(
+                                       $wgOut,
+                                       array( 'delete', 'move' ),
+                                       $this->getTitle()->getPrefixedText(),
+                                       '',
+                                       array(  'lim' => 10,
+                                               'conds' => array( "log_action != 'revision'" ),
+                                               'showIfEmpty' => false,
+                                               'msgKey' => array( 'moveddeleted-notice' )
+                                       )
+                               );
+                       }
+
                        if ( $wgEnableUploads && $wgUser->isAllowed( 'upload' ) ) {
                                // Only show an upload link if the user can upload
                                $uploadTitle = SpecialPage::getTitleFor( 'Upload' );