Last modified: 2012-11-05 11:30:02 UTC
I received the error: {"servedby":"srv301","error":{"code":"internal_api_error_MWException","info":"Exception Caught: sections not supported for content model javascript","*":""}} from my deploy script, which edits Wikipedia user script or gadget pages for Proveit (in this case User:ProveIt GT/ProveIt.js).
Could you please provide steps to reproduce the issue? Or at least what params are you passing to the api?
Sorry, the script is at http://code.google.com/p/proveit-js/source/browse/deploy.php#118 (relevant line linked). Also note that this has worked consistently in the past.
It worked in the past because pages were all considered wikitext, even if they didn't actually contain wikitext. Now with the new ContentHandler code .js pages are considered javascript by default, and Javascript doesn't have sections. Does your script really need to edit "section 0" of the Javascript page, or does it really just edit the whole page since there aren't actually any sections? If the latter, you can just remove the problematic section specification. Otherwise, you might be able to set the new contentmodel parameter to wikitext (possibly with an initial non-sectioned edit to first set the model) to get it to do what you want, but in the future (if not already) that might cause the .js page to actually be rendered as wikitext rather than Javascript. Or you could just do the "section" processing on the client side.
Thanks, that makes sense. I think I just copied that line from somewhere and left the section parameter in inadvertently. The error message could be clearer, though. It's confusing when an "internal_api_error" leaks like this.
Works as designed, closing. Please file a bug against the API if you want this error to be treated differently. But I think "sections not supported for content model javascript" is pretty clear already.