From fe2a1b0d61a4ff4540770827080ec86fb9240337 Mon Sep 17 00:00:00 2001 From: cenarium Date: Wed, 13 Jan 2016 17:43:02 +0100 Subject: [PATCH] Better guess for patrol action The "return to" guess of the patrol action for non-JS users now also checks uploads, and in that case let users return to Special:NewFiles. Change-Id: Ib8e472c16b7034524ef3b79a5eb426f7edda6ec2 --- includes/actions/MarkpatrolledAction.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/includes/actions/MarkpatrolledAction.php b/includes/actions/MarkpatrolledAction.php index 4016f6728b..ec873d9b5f 100644 --- a/includes/actions/MarkpatrolledAction.php +++ b/includes/actions/MarkpatrolledAction.php @@ -63,8 +63,14 @@ class MarkpatrolledAction extends FormlessAction { } # It would be nice to see where the user had actually come from, but for now just guess - $returnto = $rc->getAttribute( 'rc_type' ) == RC_NEW ? 'Newpages' : 'Recentchanges'; - $return = SpecialPage::getTitleFor( $returnto ); + if ( $rc->getAttribute( 'rc_type' ) == RC_NEW ) { + $returnTo = 'Newpages'; + } elseif ( $rc->getAttribute( 'rc_log_type' ) == 'upload' ) { + $returnTo = 'Newfiles'; + } else { + $returnTo = 'Recentchanges'; + } + $return = SpecialPage::getTitleFor( $returnTo ); if ( in_array( array( 'markedaspatrollederror-noautopatrol' ), $errors ) ) { $this->getOutput()->setPageTitle( $this->msg( 'markedaspatrollederror' ) ); -- 2.20.1