Page MenuHomePhabricator

Fatal errors when running refreshLinks.php and rebuildall.php with Extension:Comments enabled
Closed, ResolvedPublic

Description

When running those two maintenance scripts (refreshLinks.php and rebuildall.php), I always get these two errors:

PHP Fatal error:  Call to a member function getArticleID() on a non-object in /srv/dml-wiki/extensions/Comments/CommentClass.php on line 237
Fatal error: Call to a member function getArticleID() on a non-object in /srv/dml-wiki/extensions/Comments/CommentClass.php on line 237

which prevent the script from running, forcing me to disable the extension. I am using the latest master build as of today.

Event Timeline

Restricted Application added a project: Social-Tools. · View Herald TranscriptDec 9 2016, 6:30 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
ashley added a subscriber: ashley.Dec 9 2016, 7:17 AM

Yeah, I've seen this same error on Brickipedia quite often when manually running runJobs.php.

As a lame work-around, you could tweak the extension initialization in your wiki's LocalSettings.php:

if ( !$wgCommandLineMode ) {
	wfLoadExtension( 'Comments' );
}

This way the extension is loaded for normal requests but not for CLI requests (so you don't need to disable it by commenting out every time you want to run a maintenance script).

SamanthaNguyen moved this task from Backlog to Bugs on the Comments board.Dec 9 2016, 9:33 PM
SamanthaNguyen moved this task from Backlog to Comments on the Social-Tools board.
lcawte triaged this task as High priority.Jun 21 2017, 10:17 AM
lcawte added a subscriber: lcawte.

Breaking runs of fairly big maintenance scripts like runJobs and refreshLinks isn't a great idea...

Looks like this could be fixed by gerrit change 449761. The code path is not the same, but maybe the code was reorganized some time ago...

Ciencia_Al_Poder closed this task as Resolved.Aug 3 2018, 8:44 AM
Ciencia_Al_Poder claimed this task.

With the previous patch, refreshLinks does not fatal anymore. It should be fixed now