From 483c7d68a32a96ea51ebdb6bf26898d81da79345 Mon Sep 17 00:00:00 2001 From: Alex Monk Date: Sat, 13 Oct 2012 14:52:49 +0100 Subject: [PATCH] (bug 37714) Use log type in target object when deleting logs of the same type Change-Id: I8d721ef5784df624dc0de57adcdf75a4bc3fb604 --- includes/specials/SpecialRevisiondelete.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/includes/specials/SpecialRevisiondelete.php b/includes/specials/SpecialRevisiondelete.php index 7856e54032..eaf0d52f23 100644 --- a/includes/specials/SpecialRevisiondelete.php +++ b/includes/specials/SpecialRevisiondelete.php @@ -147,6 +147,19 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { } else { $this->typeName = $request->getVal( 'type' ); $this->targetObj = Title::newFromText( $request->getText( 'target' ) ); + if ( $this->targetObj && $this->targetObj->isSpecial( 'Log' ) ) { + $result = wfGetDB( DB_SLAVE )->select( 'logging', + 'log_type', + array( 'log_id' => $this->ids ), + __METHOD__, + array( 'DISTINCT' ) + ); + + if ( $result->numRows() == 1 ) { + // If there's only one type, the target can be set to include it. + $this->targetObj = SpecialPage::getTitleFor( 'Log', $result->current()->log_type ); + } + } } # For reviewing deleted files... -- 2.20.1