Page MenuHomePhabricator

Have software prevent draftspace pages from being placed in article categories
Open, Needs TriagePublicFeature

Description

Per WP:DRAFTNOCAT at en-WP, draft pages are not supposed to be placed in article categories. However, many newcomers are unaware of this. Further, many experienced editors choose to ignore it. As a result, many volunteers go around regularly manually disabling categories on drafts.

This task is unnecessary, as it could be integrated into the software. In an ideal application, all categories in a draft would be automatically wrapped in the draft categories template by the software, without the need to do anything to the wikitext. Exceptions should be made for Category:Wikipedia drafts and its subcategories.

Doing this would eliminate a task for patrollers, reduce confusion for newcomers, eliminate the chance readers come across a miscategorized draft while browsing categories, and allow for easier category work on drafts for all editors.

Event Timeline

Legoktm subscribed.

Confusingly it is "ArticleCreationWorkflow" that enables enwp's Draft space.

I recently learned that the Translate extension suppresses categories too (https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Translate/+/743283), so it's definitely doable. It would need some marker though (a magic word like __DRAFTCAT__ I guess?) to distinguish categories that should still work in draftspace.

Bugreporter subscribed.

The draft namespace is enabled in T59569: Create "Draft" namespace on the English Wikipedia, predates the ArticleCreationWorkflow extension and there are no codes in ArticleCreationWorkflow defining a namespace.

For the purposed usage we can use a bot or AbuseFilter.

The draft namespace is enabled in T59569: Create "Draft" namespace on the English Wikipedia, predates the ArticleCreationWorkflow extension and there are no codes in ArticleCreationWorkflow defining a namespace.

The ArticleCreationWorkflow extension provides the permissions adjustments that allow the Draft namespace to work as enwp had requested, which is what I meant by enablement, not literally enabling it - sorry about the confusion.

MediaWiki-Categories is about how categories work in MediaWiki core. I do not believe that such a feature request would be accepted in core currently, and given that core already provides the necessary functionality for an extension to do so, I don't think that tag is necessary - let me know if you disagree.

For the purposed usage we can use a bot or AbuseFilter.

AbuseFilter seems heavy-handed. A bot works but then someone needs to manually re-enable the categories once the draft is published (or I guess the publish script does that?).

The ArticleCreationWorkflow extension provides the permissions adjustments that allow the Draft namespace to work as enwp had requested, which is what I meant by enablement, not literally enabling it - sorry about the confusion.

Not really. See https://noc.wikimedia.org/conf/CommonSettings.php (search 'TitleQuickPermissions').

The ArticleCreationWorkflow extension provides the permissions adjustments that allow the Draft namespace to work as enwp had requested, which is what I meant by enablement, not literally enabling it - sorry about the confusion.

MediaWiki-extensions-ArticleCreationWorkflow intercepts article (ns:0) creations by those without the createpagemainns right - preventing creation and directing them to a landing page. It doesn't actually affect editing in the draft namespace, which is controlled in config (below).

CommonSettings.php
if ( $wgDBname === 'enwiki' ) {
	$wgHooks['TitleQuickPermissions'][] = static function ( Title $title, User $user, $action, &$errors, $doExpensiveQueries, $short ) {
		return ( $action !== 'create' || $title->getNamespace() !== 118 || !$user->isAnon() );
	};
}

What is an "article category" - how are these programmatically identified?

@Xaosflux I'd guess the programmatic definition of an article category is one that's not tagged with the maintenance category template. But for our purposes here, I think we can consider any category that's not Category:Wikipedia drafts or one of its subcategories to be something suppressible in draft space.

Per above - MediaWiki-Categories is about the core category functions and I don't think this should be in code.

I think the concept of restricting categories to a specific set of namespaces is reasonable to be in core.