Page MenuHomePhabricator

Allow the default source namespace to be changed
Closed, ResolvedPublicFeature

Description

If no namespace is specified in the <templatestyles> tag src attribute, the extension defaults to the Template namespace through this line in TemplateStylesHooks.php:

$title = Title::newFromText( $params['src'], NS_TEMPLATE );

We are storing all template styles in a TemplateStyle namespace and would like that to be the default, so we've hacked this line to modify the namespace.

Some of our reasons for doing it this way are for organization, so the template CSS subpages don't show up using LinkSuggest, and to be able to apply namespace-level editing restrictions to the template CSS.

It would be beneficial if the default namespace could be a configuration option instead, so we don't have to modify the extension after every update.

Event Timeline

Aklapper changed the subtype of this task from "Task" to "Feature Request".Sep 2 2021, 2:03 PM

@Porplemontage: Thanks for reporting this. For future reference, please use the feature request form (linked from the top of the task creation page) to create feature requests. Thanks.

@Porplemontage that sounds reasonable. Are you planning to submit a patch?

Change 716492 had a related patch set uploaded (by Porplemontage; author: Porplemontage):

[mediawiki/extensions/TemplateStyles@master] Allow the default source namespace to be changed

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

Change 716492 merged by jenkins-bot:

[mediawiki/extensions/TemplateStyles@master] Allow the default source namespace to be changed

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

taavi assigned this task to Porplemontage.