Page MenuHomePhabricator

Add message for MWUnknownContentModelException on Special:Import
Open, Needs TriagePublic

Description

When using Special:Import and then import an unknown content model, the exception MWUnknownContentModelException is thrown and import stopped, but the text is not localized to the user language when showing on Special:Import

On de I get (message importfailed):

Import fehlgeschlagen: The content model 'sanitized-css' is not registered on this wiki. See https://www.mediawiki.org/wiki/Content_handlers to find out which extensions handle this content model.

Please add a message for it to show a localized error text to the user

Event Timeline

See also:

This also affects page views post-import, which then all fatal instead of falling back to a user-error (instead server-error).

I guess this can go either way. Either we say that it should be impossible to create/import a page with an unknown content model (e.g. add error handling to import and Special:ChangeContentModel), and then we can treat instances of it at runtime as a fatal server error. Or we say that 's okay for those to be encountered, and handle them gracefully at run-time instead.

The content model 'yaml' is not registered on this wiki.
See https://www.mediawiki.org/wiki/Content_handlers to find out which extensions handle this content model.
from /srv/mediawiki/php-1.37.0-wmf.17/includes/content/ContentHandlerFactory.php(203)
#0 /srv/mediawiki/php-1.37.0-wmf.17/includes/content/ContentHandlerFactory.php(272): MediaWiki\Content\ContentHandlerFactory->validateContentHandler(string, NULL)
#1 /srv/mediawiki/php-1.37.0-wmf.17/includes/content/ContentHandlerFactory.php(191): MediaWiki\Content\ContentHandlerFactory->createContentHandlerFromHook(string)
#2 /srv/mediawiki/php-1.37.0-wmf.17/includes/content/ContentHandlerFactory.php(97): MediaWiki\Content\ContentHandlerFactory->createForModelID(string)
#3 /srv/mediawiki/php-1.37.0-wmf.17/includes/page/WikiPage.php(310): MediaWiki\Content\ContentHandlerFactory->getContentHandler(string)
#4 /srv/mediawiki/php-1.37.0-wmf.17/includes/page/WikiPage.php(296): WikiPage->getContentHandler()
#5 /srv/mediawiki/php-1.37.0-wmf.17/includes/page/Article.php(2396): WikiPage->getActionOverrides()
#6 /srv/mediawiki/php-1.37.0-wmf.17/includes/actions/ActionFactory.php(215): Article->getActionOverrides()
#7 /srv/mediawiki/php-1.37.0-wmf.17/includes/actions/ActionFactory.php(301): MediaWiki\Actions\ActionFactory->getAction(string, Article, RequestContext)
#8 /srv/mediawiki/php-1.37.0-wmf.17/includes/actions/Action.php(111): MediaWiki\Actions\ActionFactory->getActionName(RequestContext)
#9 /srv/mediawiki/php-1.37.0-wmf.17/includes/MediaWiki.php(176): Action::getActionName(RequestContext)
#10 /srv/mediawiki/php-1.37.0-wmf.17/includes/MediaWiki.php(887): MediaWiki->getAction()
#11 /srv/mediawiki/php-1.37.0-wmf.17/includes/MediaWiki.php(559): MediaWiki->main()
#12 /srv/mediawiki/php-1.37.0-wmf.17/index.php(53): MediaWiki->run()
#13 /srv/mediawiki/php-1.37.0-wmf.17/index.php(46): wfIndexMain()
#14 /srv/mediawiki/w/index.php(3): require(string)
#15 {main}