Background: https://en.wikipedia.org/wiki/Template_talk:Infobox_road#Map_data_on_Commons
Steps to reproduce
- On Commons, create a page with 'wikitext' as the content model (e.g. in Commons: namespace), but with valid JSON syntax for a .map data page
- Move the page to the Data: namespace, with a pagename that ends in .map
- Attempt to change the content model to json/map.json
Actual result
- Fails with the error "Invalid content data". Viewing the resulting data (in both wikitext and plain text model) shows a "Fatal exception of type "Exception" error.
- Note that attempting to change the content model before doing a page move does not work either.
Expected result
- The page content model will be changed
Work around
A method of working around this bug is (after moving the page to the Data: namespace with a .map page name)
- delete the page
- recreate the page using the editor (pasting in the JSON from the deleted page)
- restore the deleted revisions
which was used on https://commons.wikimedia.org/wiki/Data:Highway_192_in_Iowa_(3).map. But the process shouldn't need to be this complicated.