From: Brian Wolff Date: Fri, 2 Mar 2012 01:02:41 +0000 (+0000) Subject: (bug 34863) Make it so an image that was previously deleted and currently does not... X-Git-Tag: 1.31.0-rc.0~24431 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=162d18a7cb45f0a8116f31a3214ad80261a7e2c9;p=lhc%2Fweb%2Fwiklou.git (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. --- 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' );