Page MenuHomePhabricator

Possible to create page in item namespace (was: Better error message if default MW main page already exists)
Closed, ResolvedPublic

Description

When the web-based installer is used, a default main page is created. When later this becomes a Wikibase repo, this main page "thinks" it is an item.
The error message should make the user notice this. Instead, it says something hard to debug...

failed to deserialize

Backtrace:

#0 /srv/testrepo/w/extensions/Wikibase/lib/includes/entity/EntityFactory.php(139): Wikibase\EntityFactory->unserializedData(''''MediaWiki ha...', 'application/jso...')
#1 /srv/testrepo/w/extensions/Wikibase/repo/includes/content/ItemHandler.php(86): Wikibase\EntityFactory->newFromBlob('item', ''''MediaWiki ha...', 'application/jso...')
#2 /srv/testrepo/w/includes/Revision.php(1005): Wikibase\ItemHandler->unserializeContent(''''MediaWiki ha...', 'application/jso...')
#3 /srv/testrepo/w/includes/Revision.php(946): Revision->getContentInternal()
#4 /srv/testrepo/w/includes/WikiPage.php(616): Revision->getContent(1)
#5 /srv/testrepo/w/includes/WikiPage.php(448): WikiPage->getContent()
#6 [internal function]: WikiPage->isRedirect()
#7 /srv/testrepo/w/includes/Article.php(1944): call_user_func_array(Array, Array)
#8 /srv/testrepo/w/includes/Wiki.php(364): Article->__call('isRedirect', Array)
#9 /srv/testrepo/w/includes/Wiki.php(364): Article->isRedirect()
#10 /srv/testrepo/w/includes/Wiki.php(295): MediaWiki->initializeArticle()
#11 /srv/testrepo/w/includes/Wiki.php(555): MediaWiki->performRequest()
#12 /srv/testrepo/w/includes/Wiki.php(448): MediaWiki->main()
#13 /srv/testrepo/w/index.php(59): MediaWiki->run()
#14 {main}


Version: unspecified
Severity: minor

Details

Reference
bz42913

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:01 AM
bzimport set Reference to bz42913.
bzimport added a subscriber: Unknown Object (MLST).
silke created this task.Dec 10 2012, 1:11 PM

Some action needs to be taken to prevent this. The reason the wiki thinks it's an item is because it's in an item NS and does not have any page specific content model set. The reason it's not set is because if it's the default, it will not be set, which is the case before you set up the repo. This is a general problem for people changing the default content model of a namespace containing pages of it's default content model, and thus not specific to Wikibase.

A way to fix this would be creating a maintenance script that explicitly sets all content models for pages in a namespace, so the type can safely be switched over.

Or a script that moves all pages out of the offending-to-be namespace before switching it. A Wikibase installer script could also resolve that (among other things), how it is done in SMW e.g.

Adding many blockers of bug 38638 to the list of "easy" bugs, to mark them as candidates for [[mw:Google Code-in]] tasks (gci2013). If you think this bug is not suitable, remove the keyword.

Lydia_Pintscher removed a subscriber: Unknown Object (MLST).
Lydia_Pintscher removed a subscriber: Unknown Object (MLST).
m4tx added a subscriber: m4tx.Dec 25 2014, 1:31 AM

I wasn't able to reproduce the bug (Mediawiki 1.25alpha - rMW1913e2aced62, Wikibase Repository 0.5 alpha - e340af5). After installing Wikibase and setting the main namespace as namespace for items, Main Page still works as it did before, and I can create items in main namespace.

Is the bug still valid?

Uhhhh that would be very bad.
@Lucie: Can you please test this?

Lydia_Pintscher edited projects, added TestMe; removed I18n.Dec 27 2014, 11:40 AM
Lydia_Pintscher set Security to None.
Lydia_Pintscher removed subscribers: silke, Wikidata-bugs.
Sumit added a subscriber: Sumit.Mar 24 2015, 10:35 AM

I tried to reproduce this bug, but failed. Here's a screenshot of the version of extensions: and localsettings:
(MediaWiki version is 1.25alpha - b39e23a)
Main Page And Extensions:


Local Settings:

Am I missing something?

Lydia_Pintscher raised the priority of this task from Medium to High.Mar 24 2015, 11:05 AM

Thank you. This really should not happen. We need to investigate this.

Lydia_Pintscher renamed this task from Better error message if default MW main page already exists to Possible to create page in item namespace (was: Better error message if default MW main page already exists).Mar 24 2015, 11:05 AM
Lydia_Pintscher moved this task from incoming to ready to go on the Wikidata board.
Lydia_Pintscher added subscribers: aude, hoo.

@Lydia_Pintscher That shows that the bug has been fixed. Am I missing something?

@JanZerebecki It shows that it isn't fixed ;-) It must not be possible to create a normal wikitext page in the item namespace.

It is't possible to create one, but it existed in that namespace before the config was changed to be item only. If we were able to automatically move it during DB upgrade, i'm not sure that would be a good idea to do automatically.

Ideas what we should do?

If it is really no longer possible then we can close this. Did anyone try?