Page MenuHomePhabricator

Draft namespace not showing as publish option for some wikis
Closed, ResolvedPublic


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

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

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 [[$266|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 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)

Change 510780 merged by jenkins-bot:
[operations/mediawiki-config@master] Add Draft and Draft_talk aliases for wikis that define draft namespace

Mentioned in SAL (#wikimedia-operations) [2019-09-18T16:35:15Z] <urbanecm@deploy1001> Synchronized wmf-config/VariantSettings.php: SWAT: dc1298d: Add Draft and Draft_talk aliases for wikis that define draft namespace (T223472) (duration: 01m 02s)

Change 539134 had a related patch set uploaded (by Petar.petkovic; owner: Petar.petkovic):
[operations/mediawiki-config@master] Fix Draft namespace aliases

Change 539134 merged by jenkins-bot:
[operations/mediawiki-config@master] Fix Draft namespace aliases