Page MenuHomePhabricator

Draft namespace not showing as publish option for some wikis
Open, LowPublic

Description

Publish destinations laid out in T165562 and redesigned to be displayed inside a dialog in T197701, state that draft namespace should be a publishing options for wikis that define it. Due to the reason how additional namespaces are registered on wikis, we cannot know for sure which namespace is draft namespace with current logic. Only zhwiki and fawiki (in addition to enwiki and testwiki) will show draft namespace as publishing option, whereas there are plenty more wikis where draft namespace exists and not shown as publishing option.

Wikis with draft namespace defined, which is not showing in CX as publishing option:

Wikis with draft namespace defined, which show draft namespace as option in CX publishing settings:

Event Timeline

Restricted Application added subscribers: Cosine02, revi. · View Herald TranscriptMay 16 2019, 6:10 PM

Change 510780 had a related patch set uploaded (by Petar.petkovic; owner: Petar.petkovic):
[operations/mediawiki-config@master] Add Draft and Draft_talk aliases for wikis that define draft namespace

https://gerrit.wikimedia.org/r/510780

For all wikis, we add main and user namespace options as publishing destinations. For draft, we check if there is namespace ID for 'draft' in wgNamespaceIds. Since draft namespaces are registered as extra namespaces in wgExtraNamespaces they don't specify canonical (English) name, by which we try to find it.

In 510780, I add English names "Draft" and "Draft_talk" as aliases, so that draft namespace ID can be found by accessing wgNamespaceIds. That is how fawiki is configured and the reason draft namespace shows on that wiki inside publish settings dialog.

Downside of adding English aliases is that wikis maybe don't want these, but regular namespaces have such canonical (English) aliases as well. Also, PHP method NamespaceInfo::getCanonicalNamespaces claims it returns array of all defined namespaces with their canonical (English) names, but since extra namepaces (wgExtraNamespaces) cannot define canonical names, localized versions are returned as well, so adding alias justifies existence of this canonical (English) name.

Another downside of this solution is that future definitions of Draft namespaces for other wikis will need to add English aliases as well, and will likely miss doing so, like wikis that currently have Draft namespace defined. Since specifying canonical (English) name for extra namespaces is not possible and adding English alias helps mitigate some of the problems, I would expect there to be some policy on how new extra namespaces are added or allow specifying canonical names, so that siteinfo API can return correct canonical (English) name as well. I don't know if this is by design and who to ping about this.

Currently, only ContentTranslation and PageTriage extensions try accessing this namespace directly:

zhwiki does show Draft namespace option in publish settings dialog, but due to the way Draft extra namespace is registered (using English name as primary namespace name and Chinese name as alias) choosing that option changes from 称号 to Draft:称号. That should be 草稿:称号 instead. Obviously, I know nothing about writing or reading Chinese languages, so this may be gibberish, I just want to make a point.

The reason only primary namespace name is used, and not Chinese alias is that mw.Title uses wgFormattedNamespaces list internally, which does not include aliases.

Lastly, this seemed to be community's wish when Draft namespace was defined for zhwiki - T91223#1099514.

Pginer-WMF triaged this task as Low priority.May 17 2019, 11:13 AM
Pginer-WMF moved this task from Needs Triage to Bugs on the ContentTranslation board.

Marking as low priority since we have not much evidence that publishing in the draft namespace is highly demanded and we still provide the personal draft option as an alternative (from which users can copy content anywhere, with some manual effort)