Page MenuHomePhabricator

Call to undefined function wfDie() in profileinfo.php
Closed, ResolvedPublic

Description

Author: nickpj

Description:
Opening page like so on a test wiki: http://192.168.0.64/wiki/profileinfo.php
Fatal error: Call to undefined function wfDie() in
/var/www/hosts/mediawiki/phase3/profileinfo.php on line 54

Also when "$wgEnableProfileInfo = true;" in AdminSettings.php:
Fatal error: Call to undefined function wfDie() in
/var/www/hosts/mediawiki/phase3/profileinfo.php on line 159


Version: 1.8.x
Severity: minor

Details

Reference
bz6803

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 9:21 PM
bzimport set Reference to bz6803.
bzimport added a subscriber: Unknown Object (MLST).

ayg wrote:

Try adding

require_once( './includes/GlobalFunctions.php' );

before line 50 of profileinfo.php. It seems that it's not being loaded because
Setup.php (which includes GlobalFunctions.php) is only loaded by WebStart.php if
MW_NO_SETUP is undefined, but profileinfo does in fact define that. Note that
this is a relatively uninformed hack, since I don't know why the various files
are or are not included in various places (presumably performance), but it
should work nonetheless.

Of course, if wfDie() is being called there was going to have been a fatal error
anyway, specifically a MySQL error of some sort if the call is on line 159.

nickpj wrote:

Include globalfunctions so that wfDie() is defined.

Try adding require_once( './includes/GlobalFunctions.php' );

Thank you, that stopped the error, so I'm attaching a diff with your change.

Of course, if wfDie() is being called there was going to have been a fatal

error

anyway, specifically a MySQL error of some sort if the call is on line 159.

Seems there's no "profiling" table in the database - I haven't looked further
into this yet (presumably there's some script that can be run to create it, and
if there's not then perhaps profileinfo.php is obsolete and should be deleted).

Attached:

nickpj wrote:

Fixed by TimS in r16782 ; marking closed.