Page MenuHomePhabricator

Check $wgEnableAPI for all javascript modules using the API
Closed, ResolvedPublic

Description

OutputPage.php checks $wgUseAjax and some module specific configuration variables ($wgAjaxWatch, $wgEnableMWSuggest) before it includes javascript using AJAX. But $wgUseAjax isn't necessary, since these scripts don't use action=ajax any more. Instead it should check $wgEnableAPI (and $wgEnableWriteAPI for features that need it, like watching).
Both $wgEnableAPI and $wgEnableWriteAPIshould should also be checked together with $wgUseAJAXCategories.


Version: 1.20.x
Severity: enhancement

Details

Reference
bz30213

Event Timeline

bzimport raised the priority of this task from to Low.
bzimport set Reference to bz30213.
Schnark created this task.Aug 4 2011, 9:19 AM
brion added a comment.Aug 4 2011, 2:52 PM

Hmm, $wgEnableAPI and $wgEnableWriteAPI should probably go away entirely at this point -- the API is generally assumed to always be on and usable these days, and lots of JS-side stuff depends on it.

I agree. Though maybe ask on mediawiki-l for people that still use it and look at the possible use cases ?

Brion, Krinkle: I sent in gerrit 63259 to remove the settings, and it was
pointed out that "[...] there's been no [current?] discussion around this, and
it's actually supported just fine [...] that's the tool's fault, not a disabled
API's fault."

I suppose I could bring this up on relevant mailing lists, though before
doing so, I'll note that some expressed concern about what this change might
mean for two groups of wikis: a) private wikis and b) wikis that want to
prevent users from exporting their articles.

Do you still believe these settings ought to be removed? Or should some
$wgEnableAPI && $wgEnableWriteAPI checks be added throughout the codebase, as
stated in comment 0?

Related URL: https://gerrit.wikimedia.org/r/65785 (Gerrit Change If2ec219cfbb94e7c9718c58b9b54a508d0e0c656)

Change merged.