} 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...