From 4eb71deed7c3b5d622d1383e114e0c56466c5292 Mon Sep 17 00:00:00 2001 From: Victor Vasiliev Date: Mon, 29 Dec 2008 19:19:49 +0000 Subject: [PATCH] * Image moving over an existing file no longer throws a database error --- RELEASE-NOTES | 1 + includes/specials/SpecialMovepage.php | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 8f3d1301c8..7d6d2f127d 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -458,6 +458,7 @@ The following extensions are migrated into MediaWiki 1.14: * (bug 16772) Special:Upload now correctly rejects files with spaces in the file extension (e.g. Foo. jpg). * Ensure that all HTML id's begin with a letter as required by XHTML standard +* Image moving over an existing file no longer throws a database error === API changes in 1.14 === diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php index 4fc8b2ed3b..ba7e808bb1 100644 --- a/includes/specials/SpecialMovepage.php +++ b/includes/specials/SpecialMovepage.php @@ -305,6 +305,12 @@ class MovePageForm { return; } + // Delete an associated image if there is + $file = wfLocalFile( $nt ); + if( $file->exists() ) { + $file->delete( wfMsgForContent( 'delete_and_move_reason' ), false ); + } + // This may output an error message and exit $article->doDelete( wfMsgForContent( 'delete_and_move_reason' ) ); } -- 2.20.1