Merge "Drop index oi_name_archive_name on table oldimage"
[lhc/web/wiklou.git] / includes / exception / PermissionsError.php
index e31374c..cc69a76 100644 (file)
@@ -45,10 +45,10 @@ class PermissionsError extends ErrorPageError {
                $this->permission = $permission;
 
                if ( !count( $errors ) ) {
-                       $groups = array_map(
-                               [ 'User', 'makeGroupLinkWiki' ],
-                               User::getGroupsWithPermission( $this->permission )
-                       );
+                       $groups = [];
+                       foreach ( User::getGroupsWithPermission( $this->permission ) as $group ) {
+                               $groups[] = UserGroupMembership::getLink( $group, RequestContext::getMain(), 'wiki' );
+                       }
 
                        if ( $groups ) {
                                $errors[] = [ 'badaccess-groups', $wgLang->commaList( $groups ), count( $groups ) ];
@@ -58,6 +58,9 @@ class PermissionsError extends ErrorPageError {
                }
 
                $this->errors = $errors;
+
+               // Give the parent class something to work with
+               parent::__construct( 'permissionserrors', Message::newFromSpecifier( $errors[0] ) );
        }
 
        public function report() {