Last modified: 2014-09-24 00:00:12 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 T19145, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 17145 - Excluding specific categories from Special:UnusedCategories
Excluding specific categories from Special:UnusedCategories
Status: NEW
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-reviewed
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-24 13:51 UTC by Ahmad Sherif
Modified: 2014-09-24 00:00 UTC (History)
4 users (show)

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


Attachments
Propose patch for the enhancement (2.64 KB, patch)
2009-01-24 13:51 UTC, Ahmad Sherif
Details
Change the keyword (2.66 KB, patch)
2009-01-24 20:01 UTC, Ahmad Sherif
Details
Change the keyword and the SQL query (2.65 KB, patch)
2009-01-25 07:42 UTC, Ahmad Sherif
Details

Description Ahmad Sherif 2009-01-24 13:51:43 UTC
Created attachment 5726 [details]
Propose patch for the enhancement

Special:UnusedCategories lists all unused categories in addition to category redirects like [[Category:Wikipedia category redirects]], which makes maintaining the rest of the categories a hard job. I made a patch to add a new magic word to MediaWiki (__USEDCAT__) to exclude those categories from Special:UnusedCategories. Thank you in advance.
Comment 1 Ahmad Sherif 2009-01-24 20:01:49 UTC
Created attachment 5728 [details]
Change the keyword

This patch changes the keyword from (__USEDCAT__) to (__NOUNUSEDCAT__) per IRC discussion.
Comment 2 Aryeh Gregor (not reading bugmail, please e-mail directly) 2009-01-24 23:45:21 UTC
+		if ( isset( $this->mDoubleUnderscores['nounusedcat'] ) && $this->mTitle->getNamespace() == NS_CATEGORY ) {
+			$this->mOutput->setProperty( 'nounusedcat', 'y' );
+		}		

I don't see any code to remove this property when it's been removed from the page -- does the Parser do that implicitly?  I.e., if the magic word is removed, does it start showing up in UnusedCategories again?


+				AND pp_propname IS NULL
+				OR pp_propname != 'nounusedcat'";

I would prefer to see parentheses here: AND (... OR ...).  Otherwise it's not clear to me that the logic is correct (I can't remember which way the association goes, and I'm sure I'm not the only one).

 	'hiddencat'              => array( 1,    '__HIDDENCAT__'          ),
+	'nounusedcat'                => array( 1,    '__NOUNUSEDCAT__'            ),
 	'pagesincategory'        => array( 1,    'PAGESINCATEGORY', 'PAGESINCAT' ),

Indentation is wrong here.


I'm not sure I like the name __NOUNUSEDCAT__.  It's fairly confusing.  Something like __SKIPUNUSED__ or __IGNOREUNUSED__ or something like that would be better -- maybe it really is unused, but we want to ignore that fact, is the point.
Comment 3 Ahmad Sherif 2009-01-25 07:42:51 UTC
Created attachment 5731 [details]
Change the keyword and the SQL query

(In reply to comment #2)
> I don't see any code to remove this property when it's been removed from the
> page -- does the Parser do that implicitly?  I.e., if the magic word is
> removed, does it start showing up in UnusedCategories again?
Yes, the parser do that implicitly.

> I would prefer to see parentheses here: AND (... OR ...).  Otherwise it's not
> clear to me that the logic is correct (I can't remember which way the
> association goes, and I'm sure I'm not the only one).
Done.

> Indentation is wrong here.
Done.
Comment 4 Aryeh Gregor (not reading bugmail, please e-mail directly) 2009-01-25 12:44:11 UTC
Committed in r46196.
Comment 5 Brion Vibber 2009-01-26 23:58:51 UTC
__IGNOREUNUSED__ is a pretty confusing name, it's not at all obvious what it means. I would tend to assume that it would ignore unused category members from display on the category page, or something.
Comment 6 Aryeh Gregor (not reading bugmail, please e-mail directly) 2009-01-27 02:27:30 UTC
How about __USEDCATEGORY__?  That at least hints toward [[Special:UnusedCategories]].
Comment 7 Ahmad Sherif 2009-01-27 12:19:08 UTC
How about __IGNOREUNUSEDCAT__? It's long but at least it's not confusing. Or what about __SKIPUNUSEDCAT__?
Comment 8 Brion Vibber 2009-01-27 22:55:57 UTC
Reverted for now in r46395 pending working out a final name. 
Comment 9 Ahmad Sherif 2009-01-28 10:10:28 UTC
Maybe it needs to add SPECIAL somewhere, like __SKIPSPECIALUNUSEDCAT__.
Comment 10 Aryeh Gregor (not reading bugmail, please e-mail directly) 2009-01-28 14:19:24 UTC
What are the use-cases for this, anyway?  Just category redirects?
Comment 11 Ahmad Sherif 2009-01-28 14:31:58 UTC
Category redirects or any category that appears empty sometimes like Candidates for speedy deletion, so you can easily maintain other categories that is really unused.
Comment 12 Aryeh Gregor (not reading bugmail, please e-mail directly) 2009-01-28 14:47:03 UTC
Well, think up a name that Brion's okay with and I'll recommit it.
Comment 13 Ahmad Sherif 2009-01-28 14:53:12 UTC
I hope he finds __SKIPSPECIALUNUSEDCAT__ ok.
Comment 14 Ciphers 2009-04-02 01:35:19 UTC
Here many suggesstions, would you please pick a suitable one and commit it.
__SKIPSPECIALUNUSEDCAT__ (last suggested one)
__UNLISTUNUSEDCAT__
__HIDEUNUSEDCAT__
Comment 15 p858snake 2011-04-30 00:09:54 UTC
*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*
Comment 16 Sumana Harihareswara 2011-11-09 03:20:50 UTC
Adding "reviewed" keyword since it seems the patch was reviewed -- we're just waiting for someone to invent or choose the right name.

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


Navigation
Links