Page MenuHomePhabricator

Exception in case of missing ContentHandler
Open, Needs TriagePublic

Description

This is more a question than a feature request / bug report.

In ContentHandler::getForModelID an exception is thrown in case that no content handler is registered. This might be the case, when an extension that introduced a new content model/handler gets disabled. In such a case one would need to change all invalid contentmodel entries in the database. Until this happens, the application may crash.

How about returning a TextContentHandler as fallback, or - if side effects could appear - some kind of UnkownContentHandler (which implements all required methods, but just doesn't output/alter anything)?

[1] https://github.com/wikimedia/mediawiki/blob/3230354b544733a83f9fd6ebacfd98c01eec24ee/includes/content/ContentHandler.php#L265