Don't try and delete ForeignAPIFile or ForeignDBFile
authorSam Reed <reedy@users.mediawiki.org>
Mon, 19 Sep 2011 20:20:41 +0000 (20:20 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Mon, 19 Sep 2011 20:20:41 +0000 (20:20 +0000)
Add a space before the error message so it's not cramped up next to the page name

Add a success error message (explicit is better than guessing)

maintenance/deleteBatch.php

index 52542ce..91524f6 100644 (file)
@@ -86,8 +86,10 @@ class DeleteBatch extends Maintenance {
                        if ( $page->getNamespace() == NS_FILE ) {
                                $art = new ImagePage( $page );
                                $img = wfFindFile( $art->mTitle );
-                               if ( !$img || !$img->delete( $reason ) ) {
-                                       $this->output( "FAILED to delete image file... " );
+                               if ( !$img
+                                       || $img instanceof ForeignDBFile || $img instanceof ForeignAPIFile
+                                       || !$img->delete( $reason ) ) {
+                                       $this->output( " FAILED to delete image file... " );
                                }
                        } else {
                                $art = new Article( $page );
@@ -95,7 +97,7 @@ class DeleteBatch extends Maintenance {
                        $success = $art->doDeleteArticle( $reason );
                        $dbw->commit();
                        if ( $success ) {
-                               $this->output( "\n" );
+                               $this->output( " Deleted!\n" );
                        } else {
                                $this->output( " FAILED to delete article\n" );
                        }