Fix Race-Condition in mediawiki.page.ready OOJs-UI infusion
authorFlorian <florian.schmidt.stargatewissen@gmail.com>
Thu, 7 Jan 2016 16:46:16 +0000 (17:46 +0100)
committerFlorian <florian.schmidt.stargatewissen@gmail.com>
Thu, 7 Jan 2016 16:56:49 +0000 (17:56 +0100)
commit818841a0799c985c8f1bcf7a9e1e9efbc4625d8d
treeab79c3a147181d42b4921d6fcdb461c44bf8a7e8
parente2278426eab5db5406114c13a028d24a40566f8f
Fix Race-Condition in mediawiki.page.ready OOJs-UI infusion

It's possible, that the "catlinks" $nodes variable is re-assigned, before
mw.loader.using finished loading the mediawiki.widgets modules (which will
trigger the execution of the passed function). The function inside the
mw.loader.using call uses the $nodes variable and expects a set of infusable
OOUI elements, but (depending on the loading time of the modules) it's already
re-assigned with the .catlinks element.

Fix this by renaming the variable $nodes to $oouiNodes to break this race
condition. It's possible to rename the variable used for catlinks, but $nodes is
used in other places of the code, too, so I think this is the nicer solution.

Bug: T123074
Change-Id: Ie18b576a16c33645ab04e2957b23169bc2e17202
resources/src/mediawiki/page/ready.js