Page MenuHomePhabricator

EditPage: Preloaded page should be converted if possible and needed
Closed, ResolvedPublic

Details

Reference
bz41706

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:07 AM
bzimport set Reference to bz41706.

2012-11-02 19:26:52 srv235 ptwiki: [33a33019] /wiki/User:Aleth_Bot/common.css?action=edit&section=new&preload=foo Exception from line 529 of /usr/local/apache/common-local/php-1.21wmf2/includes/content/ContentHandler.php: Format text/css is not supported for content model wikitext
#0 /usr/local/apache/common-local/php-1.21wmf2/includes/content/ContentHandler.php(1102): ContentHandler->checkFormat('text/css')
#1 /usr/local/apache/common-local/php-1.21wmf2/includes/content/AbstractContent.php(98): TextContentHandler->serializeContent(Object(WikitextContent), 'text/css')
#2 /usr/local/apache/common-local/php-1.21wmf2/includes/EditPage.php(1955): AbstractContent->serialize('text/css')
#3 /usr/local/apache/common-local/php-1.21wmf2/includes/EditPage.php(491): EditPage->toEditText(Object(WikitextContent))
#4 /usr/local/apache/common-local/php-1.21wmf2/includes/EditPage.php(370): EditPage->displayPermissionsError(Array)
#5 /usr/local/apache/common-local/php-1.21wmf2/includes/actions/EditAction.php(51): EditPage->edit()
#6 /usr/local/apache/common-local/php-1.21wmf2/includes/Wiki.php(428): EditAction->show()
#7 /usr/local/apache/common-local/php-1.21wmf2/includes/Wiki.php(305): MediaWiki->performAction(Object(Article))
#8 /usr/local/apache/common-local/php-1.21wmf2/includes/Wiki.php(554): MediaWiki->performRequest()
#9 /usr/local/apache/common-local/php-1.21wmf2/includes/Wiki.php(447): MediaWiki->main()
#10 /usr/local/apache/common-local/php-1.21wmf2/index.php(59): MediaWiki->run()
#11 /usr/local/apache/common-local/live-1.5/index.php(3): require('/usr/local/apac...')
#12 {main}

Yes, preloading one kind of content and then trying to turn it into another will cause an error. That's by design, though admittedly the problem should be reported in a nicer way.

Try renaming the page you are trying to preload so it also has the .css extension. Please let me know whether that works, I think it should.

Anyway: For certain kinds of content automatic conversion could be supported, I suppose. But that needs a bit more thought.

I got the error "The desired destination uses a different content model. Can not convert from wikitext to CSS." when I tried to move the page.

Ugh. Damn. Of course. This is also by design, though this design seems a bit too restrictive. I'll think about how to best fix this.

Fix for the preload issue I70656b41. Fix for the move issue to follow.

Hm... will have to think about the moving stuff again. A move generally doesn't create a revision, an automatic conversion would require that. Since moving between content models wasn't part of the original request, I consider this fixed, pending positive review of the patch.

  • Bug 41996 has been marked as a duplicate of this bug. ***

I've moved all to .css, but the problem still remains: http://pt.wikipedia.org/wiki/Usu%C3%A1ria:Aleth_Bot/Revis%C3%A3o_de_bloqueio
(click on "(+) Para adicionar novo pedido clique aqui.")
Gives: [2a97776e] 2012-12-12 14:01:08: Fatal exception of type MWException

That is a different bug (due to the "section=new" in your link), which I've filed as bug 43008.

(In reply to comment #3)

I got the error "The desired destination uses a different content model. Can
not convert from wikitext to CSS." when I tried to move the page.

That is bug 43049.