Last modified: 2012-11-05 11:30:02 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 T43709, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 41709 - API error "sections not supported for content model javascript"
API error "sections not supported for content model javascript"
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Wikidata bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-02 20:42 UTC by Matthew Flaschen
Modified: 2012-11-05 11:30 UTC (History)
5 users (show)

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


Attachments

Description Matthew Flaschen 2012-11-02 20:42:05 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).
Comment 1 Jesús Martínez Novo (Ciencia Al Poder) 2012-11-02 20:46:39 UTC
Could you please provide steps to reproduce the issue? Or at least what params are you passing to the api?
Comment 2 Matthew Flaschen 2012-11-02 21:00:14 UTC
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.
Comment 3 Brad Jorsch 2012-11-02 21:16:02 UTC
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.
Comment 4 Matthew Flaschen 2012-11-02 21:54:22 UTC
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.
Comment 5 Daniel Kinzler 2012-11-05 11:30:02 UTC
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.

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


Navigation
Links