Wikipedia talk:HotCat

From Wikipedia, the free encyclopedia
Jump to: navigation, search

Please leave your comments and suggestions for HotCat.

Prevent adding certain categories?[edit]

Is there any way to tell HotCat that particular maintenance categories should not be added to pages directly, because it is preferred to use a template that includes the category link? For example, if you read the description page for Category:Disambiguation pages, one of the first things you see is a big bold notice asking you not to add it manually to any pages, but to use {{Disambiguation}} instead. However, HotCat users generally don't look at the category description pages and don't see this notice. So, is there any way within HotCat to prevent users from adding this category and similar maintenance categories? --R'n'B (call me Russ) 21:37, 20 May 2014 (UTC)

Yes, HotCat has a blacklist. See the help page. It could be configured here at the English Wikipedia to exclude such categories. Currently, only stub categories are excluded. Lupo 15:42, 23 June 2014 (UTC)
Thanks. I take it the relevant line is HotCat.blacklist = /\b[Ss]tubs?$|^[Ss]tubs?\b/;. Would there be any objection to changing it to HotCat.blacklist = /\b[Ss]tubs?$|^[Ss]tubs?\b|\b[Dd]isambiguation pages$/;? --R'n'B (call me Russ) 15:52, 23 June 2014 (UTC)
Not from me. That's fine. Lupo 18:48, 23 June 2014 (UTC)
BTW: what about Category:Airport disambiguation? Maybe you have to include that, too. But make sure you don't blacklist Category:Disambiguation categories: that one is already handeld by HotCat. Lupo 18:57, 23 June 2014 (UTC)
I think I'll just start with "... disambiguation pages" for now and see. I haven't seen the airport category causing any problems (yet). --R'n'B (call me Russ) 19:05, 23 June 2014 (UTC)
That's fine. Actually, I think Category:Disambiguation categories could be blocked, too. HotCat uses that one differently, but we don't want users to add it explicitly. But that'd be low-priority; it's just one category. Lupo 20:55, 23 June 2014 (UTC)
Since there are several disambiguation categories, how about excluding any category with "disambiguation" in it? GoingBatty (talk) 13:13, 5 July 2014 (UTC)
For that matter, every category in Category:Wikipedia maintenance categories sorted by month and Category:Wikipedia categories sorted by month (and most of the direct subcategories of those categories) shouldn't be added by HotCat. Anomie 11:29, 8 September 2014 (UTC)
Not easily doable, especially since those are whole category trees. Lupo 15:37, 8 September 2014 (UTC)

Unicode control characters[edit]

Hi, sometimes, a category is added with an extra invisible Unicode Control character (like Left-to-Right mark) at the end of the category name. Would it be possible to automatically remove it in HotCat ? Example: Joseph Brodsky (fix). --NicoV (Talk on frwiki) 12:41, 5 July 2014 (UTC)

That might be difficult to do correctly, and might need to be configurable per wiki. While page titles (and thus link targets) as stored in the database cannot contain BiDi overrides and strange Unicode spaces, links as written in the wikitext may contain such characters. Consider the following examples:

‫ لغة C++ هي لغة برمجة تستخدم...

‫ لغة C++‎ هي لغة برمجة تستخدم...

(Examples taken from Left-to-right mark and modified to use links.) Both links go tho the article C++, but the second does contain an LRM at the end. So, in general I think it would not be a good idea if HotCat tried to remove any of these invisible characters in the wikitext. It already does handle those characters when looking for categories in the wikitext, but for insertion, I fear that removing such things might lead to unexpected display issues. Lupo 12:20, 7 September 2014 (UTC)
Hi. I forgot to add this page to my watchlist, so I didn't see your answer earlier. I understand your explanation, I wonder if it applies to categories or not. Apparently (according to this discussion), it often happens that unnecessary LRM are added when copy/pasting category names with HotCats. --NicoV (Talk on frwiki) 15:41, 2 October 2014 (UTC)

Not working in Firefox[edit]

A few days ago HotCat stopped working for me in Firefox; it still does so in Chrome so it's not account-specific. I am still using F28, and I haven't upgraded my plugins, through some like NoScript do autoupdate a lot. Any idea what may be responsible? Should I start testing plugins one by one? --Piotr Konieczny aka Prokonsul Piotrus| reply here 14:35, 7 July 2014 (UTC)

Works for me with Windows 7 and Firefox 30. GoingBatty (talk) 17:36, 7 July 2014 (UTC)
Not working for me now: Win 7, FF32.--ukexpat (talk) 03:19, 7 September 2014 (UTC)
What does "not working" mean? Maybe try with your /common.js and /vector.js blanked... If it then works, you know that the problem is somewhere in that code. Any error message in the error console of FF? It works for me on FF32, OS X 10.7.5, monobook. Lupo 12:33, 7 September 2014 (UTC)
There seems to be a compatibility issue with delsort.js (or maybe the importScript() functionality). That's the only thing I have in my common.js, and as long as that's the case, HotCat will behave as if it just wasn't there (FF 43.0 on XP). --Latebird (talk) 14:54, 22 December 2014 (UTC)
Your User:Latebird/common.js is broken. importScript() is asynchronous, so the call to defineLink() in the second line runs before the script is loaded and that function exists. If there are errors in your /common.js, gadgets may not work. Lupo 17:57, 23 December 2014 (UTC)
In that case the instructions on User:Fox Wilson/delsort#Customization would be incorrect. Does MediaWiki really stop loading gadgets after anything went wrong in common.js? --Latebird (talk) 12:26, 24 December 2014 (UTC)
Yes, those instructions are wrong. That won't work reliably.
It's not that the gadget wasn't loaded, but it's not started. Gadgets that want to support configuration in the user module (that is, in a user's common.js or skin.js; like HotCat) start only once the user module is loaded. Unfortunately, if the user module has errors and raises an exception (in your case, I'd expect an entry in the error log about "defineLink not defined" or some such), the resource loader never considers the module loaded and thus the gadget never starts. Lupo 12:17, 25 December 2014 (UTC)

Disable HotCat in Draft namespace?[edit]

Since article categories do not belong on pages in the Draft namespace (see Wikipedia:Drafts#Preparing drafts & WP:DRAFTNOCAT), should HotCat be disabled in the Draft namespace? Thanks! GoingBatty (talk) 18:41, 29 January 2015 (UTC)

That could be configured in /local_defaults. Just return true for namespaceNumber 118 (and 119, if Draft talk shall also be excluded) in the HotCat.disable function override. Lupo 20:38, 29 January 2015 (UTC)
@Lupo: I went from Wikipedia:HotCat to the documentation page on Wikimedia Commons to several other places before ending up at MediaWiki:Gadget-HotCat.js/local_defaults, but I still don't see how to make the change you are suggesting. Could you please be more specific? Thanks! GoingBatty (talk) 00:47, 30 January 2015 (UTC)
Replace
  // Disable for non-logged-in users
  HotCat.disable = (function (default_disable) {
    return function () {
      if (!mw.config.get('wgUserName')) return true;
      return default_disable();
    };
  })(HotCat.disable);
by
  // Disable for non-logged-in users and in Draft namespace
  HotCat.disable = (function (default_disable) {
    return function () {
      if (!mw.config.get('wgUserName')) return true;
      var nsNum = mw.config.get('wgNamespaceNumber');
      // 118 is the Draft namespace; 119 its talk namespace
      return nsNum === 118 || nsNum === 119 || default_disable();
    };
  })(HotCat.disable);
in MediaWiki:Gadget-HotCat.js/local_defaults. (Warning: above code untested.) That should do it. Lupo 06:46, 30 January 2015 (UTC)
Thanks - edit request made at MediaWiki talk:Gadget-HotCat.js/local defaults. GoingBatty (talk) 15:42, 31 January 2015 (UTC)
  • I strongly oppose this request as it makes it harder for established editors to remove improperly placed categories on those pages. — {{U|Technical 13}} (etc) 16:05, 31 January 2015 (UTC)
Why's that? I never use HotCat - when removing a cat from most pages, I just edit the last section, mark the cat links, and press Delete. No problem. In the case of drafts, I might insert a colon instead of deleting the cat, just as I would on a miscategorised user page, but in either case, it's not a task that requires the use of HotCat. --Redrose64 (talk) 16:19, 31 January 2015 (UTC)
  • You don't, but I find it easier to use hotcat to remove categories. I can tap-tap and done... I don't have to wait for the edit page to load on my mobile browser. Just a couple taps instead of edit, scroll down, find the categories I want to remove, remove them and hope I didn't mess up anything else in that tiny 1"x2" edit window I get on my mobile, click save. I'd be happy to help make it opt-in for use of hotcat in those namespaces if requested. I'm all for making it work better for everyone. — {{U|Technical 13}} (etc) 17:18, 31 January 2015 (UTC)
I made this request after seeing an edit using HotCat to change the categories on a draft page. After reading Technical 13's first comment, I looked at the pages in Category:AfC submissions with categories before letting BattyBot change them to category links, and noticed that none of the pages had the categories added by HotCat. I agree with Redrose64 that changing them to category links is more beneficial for the editor than removing them completely. GoingBatty (talk) 17:37, 31 January 2015 (UTC)
I'd be willing to make the adjustments so that hotcat can add the prefixing : to make them links (I still prefer to remove them, and that is my personal preference as I've found often enough they shouldn't be in those categories to begin with), but I still oppose taking this tool away from editors and draft reviewers. I do agree the first step should be a modification that takes hotcat away from editors in those namespaces that aren't at least autoconfirmed. I don't care if this is done in the script itself or in the gadget definition, but will need to know how the community would like to handle it before I suggest possible code to do it that way. I'll also note that the above code does not prevent IPs from using it. — {{U|Technical 13}} (etc) 18:04, 31 January 2015 (UTC)
wgUserName is null for non-logged-in editors, so yes, the above code prevents non-logged-in users from using HotCat in normal operation. Lupo 22:53, 31 January 2015 (UTC)
BEANS, it can be overridden without much work at all. Anyways, which way does everyone want to go to permit established users to still be able to use this to remove or change existing categories on these pages? — {{U|Technical 13}} (etc) 23:17, 31 January 2015 (UTC)
Re: beans... which is why I wrote "in normal operation". You can't prevent everything. But it's a bit of a moot point, since the gadget is not default-enabled. Lupo 23:56, 31 January 2015 (UTC)
I don't think that removal of cats should be restricted. Is it possible to code HotCat in such a way that adding or amending a cat is namespace-restricted, but simple removal may be done in all namespaces? --Redrose64 (talk) 23:39, 31 January 2015 (UTC)

Removing categories?[edit]

Useful tool. The instructions seem to say it will remove categories with one click on the minus sign, but when I try to remove a category, it opens the edit page. Is there something I am doing wrong, or is this how it works? I am trying to change about a 1000 or more articles to be correctly placed in a single subcategory to replace two categories, and it would be much faster to not open the edit window. Windows 7 and Chrome or Firefox, and iPad with Safari. Thank you for the help. MicroPaLeo (talk) 20:39, 11 February 2015 (UTC)