Page MenuHomePhabricator

Multiple fatal errors ("Cannot access protected property") in ApiQueryFileRepoInfo, LocalRepo, etc.
Closed, ResolvedPublic

Description

When I try to view the API help page, I get the following error:

Fatal error: Cannot access protected property RepoGroup::$reposInitialised in /home/ki/Projects/mediawiki/core/includes/api/ApiQueryFileRepoInfo.php on line 39

This is the case for both my development installation and the labs cluster.

I checked the Git log for includes/filerepo/ForeignAPIRepo.php and found that the visibility of RepoGroup::$reposInitialised had changed in c3bef4243e93 (i.e. Wednesday night).

It looks like this error could be fixed by unconditionally calling $repoGroup->initialiseRepos() in ApiQueryFileRepoInfo::getInitialisedRepoGroup(). However, there are at least two more errors: "$repoGroup->localRepo->getInfo()" in that file, and as already mentioned on Gerrit, "PHP Fatal error: Cannot access protected property LocalRepo::$oldFileFromRowFactory in /www/translatewiki.net/w/includes/filerepo/file/LocalFile.php on line 997".

So this change should be reverted until all existing code that directly accesses the properties is changed to use getter methods.


Version: 1.23.0
Severity: normal
URL: http://deployment.wikimedia.beta.wmflabs.org/w/api.php

Details

Reference
bz57865

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:38 AM
bzimport set Reference to bz57865.
bzimport added a subscriber: Unknown Object (MLST).

(In reply to comment #0)

[...] as
already mentioned on Gerrit, "PHP Fatal error: Cannot access protected
property
LocalRepo::$oldFileFromRowFactory in
/www/translatewiki.net/w/includes/filerepo/file/LocalFile.php on line 997".

That one was fixed in https://gerrit.wikimedia.org/r/#/c/98080/.

Change 98570 had a related patch set uploaded by Aaron Schulz:
Fixed api.php fatals due to protected field usage

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

Change 98570 merged by jenkins-bot:
Fixed api.php fatals due to protected field usage

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