Page MenuHomePhabricator

Method visibility needs to change to match QueryPage
Open, Needs TriagePublicBUG REPORT

Description

Steps to Reproduce:
On MediaWiki 1.34, using the master version of ApprovedRevs, you will get several errors if requesting the Special:SpecialPages page.

The error message is similar to
`Fatal error: Access level to SpecialApprovedRevs::getOrderFields() must be public (as in class QueryPage) in /opt/htdocs/mediawiki/extensions/ApprovedRevs/includes/specials/SpecialApprovedRevs.php on line 0
`

Like the error states, method visibility is too strict, and must be made 'public' to match the visibility of the ancestor.

Actual Results:

Expected Results:

Patch:

diff --git a/includes/specials/SpecialApprovedRevs.php b/includes/specials/SpecialApprovedRevs.php
index e9da35b..eccc2e0 100644
--- a/includes/specials/SpecialApprovedRevs.php
+++ b/includes/specials/SpecialApprovedRevs.php
@@ -44,7 +44,7 @@ class SpecialApprovedRevs extends QueryPage {
                return false;
        }
 
-       protected function getPageHeader() {
+       public function getPageHeader() {
                global $egApprovedRevsEnabledNamespaces;
 
                // Show the page approval links, with the one
@@ -100,7 +100,7 @@ class SpecialApprovedRevs extends QueryPage {
         * Set parameters for standard navigation links.
         * i.e. Applies mode to next/prev links when paging through list, etc.
         */
-       protected function linkParameters() {
+       public function linkParameters() {
                // Optionally could validate $this->mMode against the two
                // link arrays.
                return $this->mMode == '' ? [] : [ 'show' => $this->mMode ];
@@ -130,15 +130,15 @@ class SpecialApprovedRevs extends QueryPage {
                return ' ORDER BY p.page_namespace, p.page_title ASC';
        }
 
-       protected function getOrderFields() {
+       public function getOrderFields() {
                return [ 'p.page_namespace', 'p.page_title' ];
        }
 
-       protected function sortDescending() {
+       public function sortDescending() {
                return false;
        }
 
-       protected function formatResult( $skin, $result ) {
+       public function formatResult( $skin, $result ) {
                // SQL for page revision approvals versus file revision approvals is
                // significantly different. Easier to follow if broken into two functions.
                if ( in_array(