Page MenuHomePhabricator

Running maintenance/PopulateContributorsTable.php: "Error: Class 'Revision' not found"
Closed, ResolvedPublicBUG REPORT

Description

Extension Contributors Update script error

MediaWiki 1.37.2 // Extension Contributors: REL1_37 (2022-03-23T07:07:35)

When launching the upgrade script (php extensions/Contributors/maintenance/PopulateContributorsTable.php), I get :

Error: Class 'Revision' not found

In the script, this is the line causing the error :

$dbr->bitAnd( 'rev_deleted', Revision::DELETED_USER ) . ' = 0'


I edited the script PopulateContributorsTable.php as suggested here: https://www.mediawiki.org/wiki/User_talk:Shirayuki:

  • Add use MediaWiki\Revision\RevisionRecord;
  • Replace Revision::DELETED_USER with RevisionRecord::DELETED_USER

However, I still get the following error:

Error 1054: Unknown column 'rev_user' in 'field list' (localhost)

Event Timeline

vscheideck updated the task description. (Show Details)
vscheideck updated the task description. (Show Details)
vscheideck updated the task description. (Show Details)

Hi @vscheideck, thanks for taking the time to report this! Please provide exact version information for MediaWiki and for the extension.

Aklapper renamed this task from Extension Contributors - ERROR - maintenance/PopulateContributorsTable.php to Running maintenance/PopulateContributorsTable.php: "Error: Class 'Revision' not found".Apr 27 2022, 6:33 AM

MediaWiki 1.37.2 // Extension Contributors: REL1_37 (2022-03-23T07:07:35)

Hi, any news? I need to upgrade my wiki. thanks for your help.

See https://www.mediawiki.org/wiki/Extension:Contributors : "This extension is currently not actively maintained!"

Change 959958 had a related patch set uploaded (by Jack Phoenix; author: Jack Phoenix):

[mediawiki/extensions/Contributors@master] Unbreak extension for MediaWiki 1.39+

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

The error mentioned in the title of this task was fixed in rECNN70067bc7fda2: Fix removed calls to 'Revision' (T258314: Remove remaining uses of Revision objects in extensions) in August. Based on some prior experience with related things, I boldly assumed that the extension's usage of the ActorMigration class would no longer work in 1.39+ and submitted the aforementioned patch to address that, and briefly verified that everything looks about right by installing the extension and manually running the PopulateContributorsTable.php script since it doesn't get run when update.php is run (and this is a reasonable approach for bigger sites with larger revision tables).

The lack of a proper, active, named maintainer or maintainers is a longer-term problem, and as explained in the commit message of my aforelinked patch, my fix is a lazy but functional hack rather than the best approach (which'll involve a bit more thinking and schema changes and a new maintenance script at least), but the Contributors extension seems simple enough that it won't need much maintenance for the years to come.

Change 959958 merged by jenkins-bot:

[mediawiki/extensions/Contributors@master] Unbreak extension for MediaWiki 1.39+

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

ashley claimed this task.
ashley removed a project: Patch-For-Review.