Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/149783

Change subject: Move adjustment of revision delete target in 
SpecialRevisiondelete to fix fatal
......................................................................

Move adjustment of revision delete target in SpecialRevisiondelete to fix fatal

targetObj needs to be set correctly before accessing the RevisionList,
and trying to get the 'current'.  If not set correctly, then $title
given to RevisionList (and it's subclasses) is Special:Revisiondelete
and rev_page is 0. So nothing is found for 'current' and a fatal
error happens.

Follow-up to Id1baacb

Bug: 68566
Change-Id: Ic078af5417798db1b2900057dbf7514112e94b46
(cherry picked from commit 570b6bdffee3ef1a81cfc83f0fdb7d8a15ea77a6)
---
M includes/specials/SpecialRevisiondelete.php
1 file changed, 8 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/83/149783/1

diff --git a/includes/specials/SpecialRevisiondelete.php 
b/includes/specials/SpecialRevisiondelete.php
index 9cec847..93df289 100644
--- a/includes/specials/SpecialRevisiondelete.php
+++ b/includes/specials/SpecialRevisiondelete.php
@@ -160,6 +160,14 @@
                if ( !$this->typeName || count( $this->ids ) == 0 ) {
                        throw new ErrorPageError( 'revdelete-nooldid-title', 
'revdelete-nooldid-text' );
                }
+
+               # Allow the list type to adjust the passed target
+               $this->targetObj = RevisionDeleter::suggestTarget(
+                       $this->typeName,
+                       $this->targetObj,
+                       $this->ids
+               );
+
                $this->typeLabels = self::$UILabels[$this->typeName];
                $list = $this->getList();
                $list->reset();
@@ -169,13 +177,6 @@
                        !$this->getUser()->isAllowed( 'suppressrevision' );
                $pageIsSuppressed = $bitfield & Revision::DELETED_RESTRICTED;
                $this->mIsAllowed = $this->mIsAllowed && !( 
$canViewSuppressedOnly && $pageIsSuppressed );
-
-               # Allow the list type to adjust the passed target
-               $this->targetObj = RevisionDeleter::suggestTarget(
-                       $this->typeName,
-                       $this->targetObj,
-                       $this->ids
-               );
 
                $this->otherReason = $request->getVal( 'wpReason' );
                # We need a target page!

-- 
To view, visit https://gerrit.wikimedia.org/r/149783
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic078af5417798db1b2900057dbf7514112e94b46
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.24wmf15
Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Aude <aude.w...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to