From 162d18a7cb45f0a8116f31a3214ad80261a7e2c9 Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Fri, 2 Mar 2012 01:02:41 +0000 Subject: [PATCH] (bug 34863) Make it so an image that was previously deleted and currently does not exist (locally or foreignly), shows a snippet from the deletion (and move) log. 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 | 1 + includes/ImagePage.php | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/RELEASE-NOTES-1.20 b/RELEASE-NOTES-1.20 index d0bceee67e..1a58fe6046 100644 --- a/RELEASE-NOTES-1.20 +++ b/RELEASE-NOTES-1.20 @@ -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. diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 7e72db909e..b41e12646f 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -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' ); -- 2.20.1