Semanticmediawiki: Cannot uninstall SMW

Created on 17 Jan 2021  路  10Comments  路  Source: SemanticMediaWiki/SemanticMediaWiki

Once you install a recent version of SMW it can not be uninstalled without partially braking the wiki.

MWUnknownContentModelException from line 201 of /var/www/mediawiki/includes/content/ContentHandlerFactory.php: The content model 'smw/schema' is not registered on this wiki.

This is because SMW creates these pages:

bug

Most helpful comment

... who want's to unintstall SMW ;-)

All 10 comments

You can't even delete those pages...

You can't even delete those pages...

You can however I is necessary to have SMW installed to do so due to SMW providing the namespace.

Another way would be to change the page content model of the pages to something provided by core e.g. JSON. Yeah, MW does not seem to be ready for handling content models provided by extensions when it comes to "failing".

Still, all of this is indeed cumbersome to do when uninstalling SMW.

... who want's to unintstall SMW ;-)

You can [delete those pages]

On my dev wiki the delete buttons did not show up even though I was logged in as admin. Same at https://maps.extension.wiki/wiki/smw/schema:Group:Predefined_properties

@JeroenDeDauw maybe you are missing the user right smw-schemaedit in the Curators (Semantic MediaWiki) group. See: https://www.semantic-mediawiki.org/wiki/Help:User_rights_and_groups and https://www.semantic-mediawiki.org/wiki/Data_curator

@cicalese are you aware of any fix for this kind of issue? Also: rather silly the content model stuff breaks maintenance scripts completely once you have a single page with an unknown model :

I will check and get back to you!

Try adding $wgContentHandlers['smw/schema'] = FallbackContentHandler::class; to your LocalSettings.php

Try adding $wgContentHandlers['smw/schema'] = FallbackContentHandler::class; to your LocalSettings.php

MWException from line 243 of /var/www/html/includes/content/ContentHandlerFactory.php: Wrong Argument HandlerSpec for ModelID: smw/schema. Error: Provided specification is not an array.

Ah, FallbackContentHandler is not yet present in the latest released MediaWiki version. This works on MW 1.35:

$wgContentHandlers['smw/schema'] = JsonContentHandler::class;

And you can avoid SMW creating this stuff automatically on setup by:

$smwgImportReqVersion = false;

Still, MW really should not break like this...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mwjames picture mwjames  路  3Comments

krabina picture krabina  路  4Comments

plegault3397 picture plegault3397  路  3Comments

seth2740 picture seth2740  路  3Comments

JeroenDeDauw picture JeroenDeDauw  路  3Comments