https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112864
Revision: 112864
Author: bawolff
Date: 2012-03-02 01:02:41 +0000 (Fri, 02 Mar 2012)
Log Message:
-----------
(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.
Modified Paths:
--------------
trunk/phase3/RELEASE-NOTES-1.20
trunk/phase3/includes/ImagePage.php
Modified: trunk/phase3/RELEASE-NOTES-1.20
===================================================================
--- trunk/phase3/RELEASE-NOTES-1.20 2012-03-02 00:47:30 UTC (rev 112863)
+++ trunk/phase3/RELEASE-NOTES-1.20 2012-03-02 01:02:41 UTC (rev 112864)
@@ -37,6 +37,7 @@
* (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.
Modified: trunk/phase3/includes/ImagePage.php
===================================================================
--- trunk/phase3/includes/ImagePage.php 2012-03-02 00:47:30 UTC (rev 112863)
+++ trunk/phase3/includes/ImagePage.php 2012-03-02 01:02:41 UTC (rev 112864)
@@ -468,6 +468,22 @@
}
} 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' );
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs