Last modified: 2014-06-17 17:02:56 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T24584, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 22584 - 'BeforePageDisplay' hook is not being called in Extension:UsabilityInitiative r62695 with "Vector enhancements" turned on
'BeforePageDisplay' hook is not being called in Extension:UsabilityInitiative...
Status: RESOLVED FIXED
Product: MediaWiki skins
Classification: Unclassified
Vector (Other open bugs)
unspecified
All All
: Normal normal
: ---
Assigned To: Trevor Parscal
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-02-19 11:53 UTC by Dmitriy Sintsov
Modified: 2014-06-17 17:02 UTC (History)
5 users (show)

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


Attachments

Description Dmitriy Sintsov 2010-02-19 11:53:03 UTC
I am trying to make sure that my (yet unreleased) extension will work with future versions of MediaWiki. My extension needs a hook 'BeforePageDisplay' to process and generate some data. With js2-work r62694 and Extension:UsabilityInitiative r62695 and having in LocalSettings.php:

# Vector enhancements (CollapsibleTabs, SimpleSearch, EditWarning)
require_once( "$IP/extensions/UsabilityInitiative/Vector/Vector.php" );

'BeforePageDisplay' is not called. When I comment out the second line:

#require_once( "$IP/extensions/UsabilityInitiative/Vector/Vector.php" );

'BeforePageDisplay' works again.
Comment 1 Roan Kattouw 2010-02-19 11:59:21 UTC
Works for me with phase3 and UsabilityInitiative (both at r62695):

function blah() { die("blah"); }
require_once("$IP/../extensions/ParserFunctions/ParserFunctions.php");
require_once("$IP/../extensions/UsabilityInitiative/Vector/Vector.php");
require_once("$IP/../extensions/UsabilityInitiative/WikiEditor/WikiEditor.php");
require_once("$IP/../extensions/UsabilityInitiative/OptIn/OptIn.php");
require_once("$IP/../extensions/UsabilityInitiative/ClickTracking/ClickTracking.php");
$wgHooks['BeforePageDisplay'][] = 'blah';

Outputs "blah"

This could be a bug in js2-work, or simply a bug in your BeforePageDisplay hook function (sure you got the name right? Did you try adding die("blah") at the beginning?)
Comment 2 Dmitriy Sintsov 2010-02-19 15:06:29 UTC
Roan, could you try with js2-work, please? Or, perhaps your area of development is unrelated to js2-work, then, perhaps someone else can try it?
My extension works at two different installations (win,linux) with 1.15.1, so that should not be a simple typo. Also, the extension works when I comment out the "Vector enhancement" line.
Comment 3 Dmitriy Sintsov 2010-02-19 15:14:06 UTC
Here is the link to my unreleased extension:
http://mediawiki.narod.ru/EditConflict_0.4.1.tgz
there is no typo in hook call, indeed it works for long time.
Comment 4 Dmitriy Sintsov 2010-02-19 15:23:43 UTC
There is no hook $wgHooks['EditPageMergeChanges'][] = 'EditConflict::doEditConflict'; currently defined in MediaWiki core, but that is unrelated, because that hook is only optional (via the simple patch of EditPage.php) and the extension works without patching of core. (The core patching is only an enhancement, not an requirement to run my extension).
Comment 5 Dmitriy Sintsov 2010-02-19 17:05:00 UTC
Even, http://mediawiki.narod.ru/EditConflict_0.4.2.tgz
fixed some small bugs. Although, it was working with MediaWiki 1.15.1 and a clean js2-work r62695 without UsabilityInitiative + Vector enhancement, too (I've turned on most of another enhancements according to UsabilityInitiative installation instructions, but it was the Vector enhancement which prevented 'BeforePageDisplay' to be called).
Comment 6 Roan Kattouw 2010-02-19 20:42:48 UTC
Could you try with trunk instead of js2-work? If the very same thing works in trunk but is broken in js2-work, it's definitely not Vector's fault.
Comment 7 Michael Dale 2010-02-19 21:18:58 UTC
I have not merged updates from trunk into js2-work for sometime. Dmitriy why are you using js2-work branch? ( that branch is under development with only really only the /js part being maintained ) 

You should use trunk and wait until the updated javascript api stuff makes its way into trunk before worrying about future proofing your extension.
Comment 8 Dmitriy Sintsov 2010-02-20 02:02:29 UTC
Allright, I'll try the trunk. I've thought that more visual enhancements will be available with js2-work (such as AJAX uploads and so on). I haven't studied last year changes in detail, but certainly that is a bigger than usual step between the core versions (when moving from 1.15.1).
Michael, if you are going to merge changes someday, you may close this bug. I wonder if some kind of automatical test (phpunit?) especially for hooks can be made. Perhaps, a test extension which would make sure that no hook calls are missed.
Comment 9 Siebrand Mazeland 2011-08-03 06:46:45 UTC
Is this still relevant, or "Oh so fixed"?

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


Navigation
Links