Last modified: 2011-08-26 03:54:08 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T22616, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 20616 - Name of excluded-in-print category cannot start with a namespace name
Name of excluded-in-print category cannot start with a namespace name
Status: RESOLVED WONTFIX
Product: MediaWiki extensions
Classification: Unclassified
Collection (Other open bugs)
unspecified
All All
: Normal minor with 1 vote (vote)
: ---
Assigned To: PediaPress Development Team
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-09-12 16:10 UTC by Mormegil
Modified: 2011-08-26 03:54 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Mormegil 2009-09-12 16:10:42 UTC
The name of the template exclusion category, specified in [[MediaWiki:coll-exclusion_category_title]], cannot start with something resembling a namespace name. E.g. the category cannot be named [[Category:Project:Excluded in print]], since “Project:” seems like a namespace prefix.

The problem is that Collection passes the name (template_exclusion_category) without the “Category:” prefix, while mwlib parses the given name with “Category:” being _only the default_ (i.e. if the name does not specify a namespace, assume Category, otherwise use the specified namespace – see nshandler.splitname used in fetch.py).

The problem might be worked around by specifying the full name of the category (i.e. set [[MediaWiki:coll-exclusion_category_title]] to “Category:Project:Excluded in print” instead of just “Project:Excluded in print”), but in that case, you also need to tweak [[MediaWiki:Coll-excluded-templates]], so that it does not add a second “Category:” prefix.

Anyway, the proper solution would be to either change mwlib so that the Category NS is not just a default, but is used always, or fix Collection.body.php to set template_exclusion_category to the full name of the category (including the “Category:” prefix) when passing it to MWServe.
Comment 1 Ralf Schmitt 2011-08-25 09:35:41 UTC
Thanks for your detailed explanation. Since specifying the full name including the Category: prefix works, we won't fix that. IMHO, the software just does, what it's told to do.
Comment 2 Mormegil 2011-08-25 09:50:02 UTC
(In reply to comment #1)
> Since specifying the full name including
> the Category: prefix works, we won't fix that.

The workaround is not a perfect solution. For one thing, in the [[MediaWiki:Coll-excluded-templates]] message, you cannot get rid of the “Category:” prefix. The default displays “Templates in category Exclude in print have been excluded.” When working around the bug, you will receive “Templates in category Category:Exclude in print have been excluded.” (you can remove the word “category”, but not the “Category:” prefix).

> IMHO, the software just does, what it's told to do.

Well, no, not really. When you set [[MediaWiki:coll-exclusion_category_title]] to e.g. “Project Nonprintable”, it works and templates within [[Category:Project Nonprintable]] are excluded. When you change it so slightly to “Project:Nonprintable”, it does not work and _no_ templates are excluded. It requires digging in the code to learn why all templates are printed, and learn how you could change two messages to make it work. (This is how I discovered the problem – templates kept being rendered on the Czech Wikipedia, ignoring the nonprintable template category. Nobody knew what the problem was until I analyzed the code and discovered that our choice of the name for the exclusion category was troublesome.)
Comment 3 Bawolff (Brian Wolff) 2011-08-26 03:54:08 UTC
The behaviour described seems really non-intuitive for something that's working as intended...

>fix
>Collection.body.php to set template_exclusion_category to the full name of the
>category (including the “Category:” prefix) when passing it to MWServe

imho that seems logical.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links