X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FFileDeleteForm.php;h=f850152050c0fa271eba198a0f1f1bf21554085e;hb=32ab5d2f7ab95209d56270a3b1264e9289c88b7d;hp=65638f286f70c2df3938022699fe8699202684b3;hpb=fd8a5d468934398595874783fa75ae2bf1b2b482;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/FileDeleteForm.php b/includes/FileDeleteForm.php index 65638f286f..f850152050 100644 --- a/includes/FileDeleteForm.php +++ b/includes/FileDeleteForm.php @@ -125,7 +125,7 @@ class FileDeleteForm { $status->getWikiText( 'filedeleteerror-short', 'filedeleteerror-long' ) . '' ); } - if ( $status->ok ) { + if ( $status->isOK() ) { $wgOut->setPageTitle( wfMessage( 'actioncomplete' ) ); $wgOut->addHTML( $this->prepareMessage( 'filedelete-success' ) ); // Return to the main page if we just deleted all versions of the @@ -150,11 +150,12 @@ class FileDeleteForm { * @param string $reason Reason of the deletion * @param bool $suppress Whether to mark all deleted versions as restricted * @param User $user User object performing the request + * @param array $tags Tags to apply to the deletion action * @throws MWException - * @return bool|Status + * @return Status */ public static function doDelete( &$title, &$file, &$oldimage, $reason, - $suppress, User $user = null + $suppress, User $user = null, $tags = [] ) { if ( $user === null ) { global $wgUser; @@ -178,6 +179,7 @@ class FileDeleteForm { $logEntry->setPerformer( $user ); $logEntry->setTarget( $title ); $logEntry->setComment( $logComment ); + $logEntry->setTags( $tags ); $logid = $logEntry->insert(); $logEntry->publish( $logid ); @@ -192,7 +194,8 @@ class FileDeleteForm { $dbw->startAtomic( __METHOD__ ); // delete the associated article first $error = ''; - $deleteStatus = $page->doDeleteArticleReal( $reason, $suppress, 0, false, $error, $user ); + $deleteStatus = $page->doDeleteArticleReal( $reason, $suppress, 0, false, $error, + $user, $tags ); // doDeleteArticleReal() returns a non-fatal error status if the page // or revision is missing, so check for isOK() rather than isGood() if ( $deleteStatus->isOK() ) {