Error
MediaWiki version: 1.35.0-wmf.37
MWException: Bad content model: expected wikitext but got javascript.
MediaWiki version: 1.35.0-wmf.37
MWException: Bad content model: expected wikitext but got javascript.
#0 /srv/mediawiki/php-1.35.0-wmf.37/includes/content/TextContentHandler.php(70): ContentHandler->checkModelID(string)
#1 /srv/mediawiki/php-1.35.0-wmf.37/includes/api/ApiStashEdit.php(120): TextContentHandler->merge3(WikitextContent, WikitextContent, JavaScriptContent)
#2 /srv/mediawiki/php-1.35.0-wmf.37/includes/api/ApiMain.php(1585): ApiStashEdit->execute()
#3 /srv/mediawiki/php-1.35.0-wmf.37/includes/api/ApiMain.php(525): ApiMain->executeAction()
#4 /srv/mediawiki/php-1.35.0-wmf.37/includes/api/ApiMain.php(496): ApiMain->executeActionWithErrorHandling()
#5 /srv/mediawiki/php-1.35.0-wmf.37/api.php(84): ApiMain->execute()
#6 /srv/mediawiki/w/api.php(3): require(string)
#7 {main}| Subject | Repo | Branch | Lines +/- | |
|---|---|---|---|---|
| API: Handle ContentHandler exception for content model mismatch | mediawiki/core | master | +86 -3 |
The page was originally created in Draft namespace (default contentmodel = wikitext ). The author likely then attempted editing it, thus the revision he fetched was in wikitext contentmodel. He took like 17 minutes working on the edit, and in the meanwhile, the content model of the page was changed to javascript. Later when he wanted to save, exception was thrown in ContentHanlder since the page now has content model different from that of the fetched revision. In EditPage this is handled with 'contentmodelediterror' error, but the API is not handling it.
Change 606844 had a related patch set uploaded (by Ammarpad; owner: Ammarpad):
[mediawiki/core@master] API: Handle ContentHandler exception for content model mismatch
Change 606844 merged by jenkins-bot:
[mediawiki/core@master] API: Handle ContentHandler exception for content model mismatch