Last modified: 2008-09-14 14:33:16 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 T14351, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 12351 - Possibility to ignore namespace in sorting categories
Possibility to ignore namespace in sorting categories
Status: RESOLVED DUPLICATE of bug 6387
Product: MediaWiki
Classification: Unclassified
Categories (Other open bugs)
1.12.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-12-19 10:57 UTC by Thomas Bleher
Modified: 2008-09-14 14:33 UTC (History)
1 user (show)

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


Attachments

Description Thomas Bleher 2007-12-19 10:57:08 UTC
On Wikis with two or more content namespaces, categories don't look so nice because all articles of a namespace (say Help:) are grouped under "H" by default.

This patch introduces the option to completely ignore the namespace for sorting in category pages.

--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -2114,6 +2114,12 @@ $wgCategoryMagicGallery = true;
 $wgCategoryPagingLimit = 200;
 
 /**
+ * Sort pages in categories by namespace first (e.g. group all Talk pages together)
+ * Warning: This will only affect newly saved pages!
+ */
+$wgUseNamespaceInCategorySort = true;
+	
+/**
  * Browser Blacklist for unicode non compliant browsers
  * Contains a list of regexps : "/regexp/"  matching problematic browsers
  */
--- a/includes/Parser.php
+++ b/includes/Parser.php
@@ -4866,10 +4866,11 @@ class Parser
 	 * @return string
 	 */
 	public function getDefaultSort() {
+		global $wgUseNamespaceInCategorySort;
 		if( $this->mDefaultSort !== false ) {
 			return $this->mDefaultSort;
 		} else {
-			return $this->mTitle->getNamespace() == NS_CATEGORY
+			return ($this->mTitle->getNamespace() == NS_CATEGORY || !$wgUseNamespaceInCategorySort)
 					? $this->mTitle->getText()
 					: $this->mTitle->getPrefixedText();
 		}


Comments?
Comment 1 Roan Kattouw 2007-12-19 16:47:01 UTC
(In reply to comment #0)
> On Wikis with two or more content namespaces, categories don't look so nice
> because all articles of a namespace (say Help:) are grouped under "H" by
> default.
> 
> Comments?
> 
Consistently using [[Category:Mycat|{{PAGENAME}}]] solves this issue.

WONTFIX?
Comment 2 Thomas Bleher 2007-12-19 19:37:48 UTC
Yes, using [[Category:Mycat|{{PAGENAME}}]] (or even {{DEFAULTSORT:{{PAGENAME}}}}) works, but isn't this a bit hard on the users? 

IMHO, manually doing this just wastes time. We already do this for categories, so I think it makes sense to allow it for other namespaces, too.
Comment 3 Thomas Bleher 2008-09-14 14:33:16 UTC
Fixed in r38992, configuration variable is $wgCategoryPrefixedDefaultSortkey.

*** This bug has been marked as a duplicate of bug 6387 ***

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


Navigation
Links