From: cenarium Date: Wed, 13 Jan 2016 16:43:02 +0000 (+0100) Subject: Better guess for patrol action X-Git-Tag: 1.31.0-rc.0~8349^2 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=fe2a1b0d61a4ff4540770827080ec86fb9240337;p=lhc%2Fweb%2Fwiklou.git 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 --- 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' ) );