For some reason, I can't access Special:Undelete for one particular page (/w/index.php?title=Special:Undelete&target=Miraheze%2Fit), because it throws a 'permission denied' error, despite I am in the sysop group:
You do not have permission to view this page's deleted history, for the following reason:
The action you have requested is limited to users in one of the groups: Administrators, oversight.
The following code block in includes/specials/SpecialUndelete.php (introduced in https://gerrit.wikimedia.org/r/#/c/154868/) causes this:
/** * Checks whether a user is allowed the permission for the * specific title if one is set. * * @param string $permission * @param User $user * @return bool */ protected function isAllowed( $permission, User $user = null ) { $user = $user ?: $this->getUser(); if ( $this->mTargetObj !== null ) { return $this->mTargetObj->userCan( $permission, $user ); } else { return $user->isAllowed( $permission ); } }
If isAllowed *only* returns the value of $user->isAllowed( $permission ); the special page works fine for me, so I am sure that $this->mTargetObj->userCan( $permission, $user ); is somehow being the culprit here. $user seems to be an object containing my user account, so that's not the issue
What I know is that $this->mTargetObj->userCan() is actually Title::userCan(), and that just returns "!count( $this->getUserPermissionsErrorsInternal( $action, $user, $rigor, true ) );". Title::getUserPermissionsErrorsInternal() returns "$errors;", and when I do a var_dump( $errors ); just before it returns $errors, I get the following output:
array(0) { } array(1) { [0]=> array(3) { [0]=> string(15) "tpt-target-page" [1]=> string(9) ":Miraheze" [2]=> string(113) "https://meta.miraheze.org/w/index.php?title=Special:Translate&group=page-Miraheze&action=page&filter=&language=it" } } array(1) { [0]=> array(3) { [0]=> string(15) "tpt-target-page" [1]=> string(9) ":Miraheze" [2]=> string(113) "https://meta.miraheze.org/w/index.php?title=Special:Translate&group=page-Miraheze&action=page&filter=&language=it" } } array(1) { [0]=> array(3) { [0]=> string(15) "tpt-target-page" [1]=> string(9) ":Miraheze" [2]=> string(113) "https://meta.miraheze.org/w/index.php?title=Special:Translate&group=page-Miraheze&action=page&filter=&language=it" } } array(1) { [0]=> array(1) { [0]=> string(19) "ns-specialprotected" } } array(0) { } array(1) { [0]=> array(1) { [0]=> string(19) "ns-specialprotected" } }
This does not happen on each deleted page, only this page (Miraheze/it) seems to cause this error. I run MediaWiki 1.26 with HHVM 3.9 LTS. Config is available at https://github.com/miraheze/mw-config.
Can you please look at this?