Page MenuHomePhabricator

check wgEnableAPI before use the api
Closed, DeclinedPublic

Description

Please check the js var wgEnableAPI before use the api. Because the api can be disabled (temporarily) by server admins.

Thanks.


Version: unspecified
Severity: enhancement

Details

Reference
bz24335

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 11:05 PM
bzimport set Reference to bz24335.

Hi Umherirrender,
which exact API does this refer to nowadays? WikiEditor? Could you provide a pointer to the place in the codebase?

Andre: wgEnableAPI is for the web API (/w/api.php). See bug 30213.

I'm marking this RESOLVED WONTFIX because the UsabilityInitiative extension is obsolete, having been split up quite a while ago (the surviving portions became the Vector and WikiEditor extensions).

https://www.mediawiki.org/wiki/Extension:UsabilityInitiative

Also, as noted on bug 30213, the $wgEnableAPI config setting should probably just be eliminated (and the API permanently enabled).

(In reply to comment #1)

Hi Umherirrender,

which exact API does this refer to nowadays? WikiEditor?

Could you provide a

pointer to the place in the codebase?

In theroy all ajax calls from the MediaWiki GUI like action=watch. But that is never checked, so killing this is also a valid option. The api is stable (from a performance point of view) and when there are problems, now the corrosponding api module is disabled and not the whole api. So WONTFIX is okay.

Disabling the API just breaks the hell out of a lot of UI stuff, so instead of honoring that variable we indeed should work towards removing it.