* Image moving over an existing file no longer throws a database error
authorVictor Vasiliev <vasilievvv@users.mediawiki.org>
Mon, 29 Dec 2008 19:19:49 +0000 (19:19 +0000)
committerVictor Vasiliev <vasilievvv@users.mediawiki.org>
Mon, 29 Dec 2008 19:19:49 +0000 (19:19 +0000)
RELEASE-NOTES
includes/specials/SpecialMovepage.php

index 8f3d130..7d6d2f1 100644 (file)
@@ -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 ===
 
index 4fc8b2e..ba7e808 100644 (file)
@@ -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' ) );
                }