Last modified: 2009-04-06 12:41:46 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 18009 - "closure" callables not supported
"closure" callables not supported
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: newphp
Depends on:
  Show dependency treegraph
Reported: 2009-03-16 20:18 UTC by Jack Bates
Modified: 2009-04-06 12:41 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Jack Bates 2009-03-16 20:18:30 UTC
I tried taking advantage of PHP 5.3's "closures":

- to define a hook in my LocalSettings.php:

$wgHooks['BeforePageDisplay'][] = function ( &$out, &$sk ) {
        $out->addScript( '<script src="autolink.js" type="text/javascript"></script>' );

	return true;

However MediaWiki produced the following excetion:

<b>Warning</b>:  call_user_func_array() expects parameter 1 to be a valid callback, class 'Closure' does not have a method 'onBeforePageDisplay' in <b>/home/jablko/public_html/mediawiki/includes/Hooks.php</b> on line <b>117</b><br />
MediaWiki internal error.<br />
Comment 1 Alexandre Emsenhuber [IAlex] 2009-04-06 12:41:46 UTC
fixed in r49243.

Note You need to log in before you can comment on or make changes to this bug.