User talk:Danski454/stubsearch
Wanted to move issue discussions directly to the script page. I tried the stub template removal/replacement option on Roman Catholic Diocese of Qinzhou, and it did something weird. This page originally had 2 stub templates, and while the {{PRChina-RC-diocese-stub}}
got added, the {{lorem}}
template got added. I reverted the change and ended up using the script to add the {{PRChina-RC-diocese-stub}}
template, then manually removed the other two by hand. -Furicorn (talk) 05:56, 28 October 2018 (UTC)
- @Furicorn: Fixed, I copied the get wikitext syntax from the user script guide, but forgot to change the title from Wikipedia:Sandbox to the current page name. Self-trout --Danski454 (talk) 10:47, 28 October 2018 (UTC)
- @Danski454: Thanks, that worked. 2 more (hopefully) small things I noticed:
- When the script is replacing a stub template, can it also add 2 line breaks between the first stub templates and whatever is above them? That will help ensure that it follows WP:STUBSPACING, which is that stub templates should always be at the bottom and be spaced 2 line breaks below whatever is above them.
- It would also be helpful if, when adding a stub template (as opposed to replacing), either to a page without a template or to a page with an existing template, the script can check to make sure there are two line breaks before the first stub template, and add line breaks if needed.
- At about Line 285, there's an extra "m" --> "Replace old stub temmplates with"
- When the script is replacing a stub template, can it also add 2 line breaks between the first stub templates and whatever is above them? That will help ensure that it follows WP:STUBSPACING, which is that stub templates should always be at the bottom and be spaced 2 line breaks below whatever is above them.
- Again, thanks for the work
- -Furicorn (talk) 18:53, 28 October 2018 (UTC)
- @Furicorn: I've implemented those features (note: the script now automatically loads the diff when adding templates as well as when replacing) --Danski454 (talk) 20:41, 28 October 2018 (UTC)
- Tried the replace all function on Montenegro at the European Games, worked like a charm! Thanks for working on this, this will be so helpful. -Furicorn (talk) 22:23, 28 October 2018 (UTC)
- @Furicorn: I've implemented those features (note: the script now automatically loads the diff when adding templates as well as when replacing) --Danski454 (talk) 20:41, 28 October 2018 (UTC)
- @Danski454: Thanks, that worked. 2 more (hopefully) small things I noticed:
Adding Multiple stubs and multiple searches
[edit]Some more things I thought of:
- Sometimes when processing a page that was tagged with
{{stub}}
to put on more specific stubs, I'll want to add multiple more specific templates. For example, with a Chinese government sponsored think tank, I might want to add both{{China-org-stub}}
and{{PRChina-gov-stub}}
. - When I'm searching for the correct stub category and my first search is wrong or doesn't match, I'll need to search again. If I've already hit the search button, I can't figure out any way to search again without refreshing the page.
Hopefully these are things you'll be able to look at. -Furicorn (talk) 23:11, 28 October 2018 (UTC)
- @Furicorn: Regarding number 2, you can change your search just by typing in a new search and clicking search. I'll work on number 1 later. --Danski454 (talk) 07:30, 29 October 2018 (UTC)
- Thanks what you said re:2 worked, glad I was just doing it wrong before :). Definitely no rush on 1, I'll look forward to it. -Furicorn (talk) 09:44, 29 October 2018 (UTC)
- @Furicorn: I've added a checkbox to the add template interface that allows you to choose not to load the diff. It defaults to loading the diff. There is also a button to load the diff at any time if you have made an edit. Danski454 (talk) 12:39, 3 November 2018 (UTC)
UAE stubs?
[edit]I noticed that searching "United Arab Emirates" pulls a bunch of specific sub tags, but these aren't in the "United Arab Emirates stubs" category. — Insertcleverphrasehere (or here) 10:40, 29 October 2018 (UTC)
- @Insertcleverphrasehere: It's a little hard to tell because there's so many results, but if you type out "United Arab Emirates", the category shows up at the bottom. It's more obvious if you search "United Arab Emirates stub" -Furicorn (talk) 10:53, 29 October 2018 (UTC)
- @Furicorn: I meant that the other stubs are not contained inside the "United Arab Emirates" category, and should be. — Insertcleverphrasehere (or here) 10:54, 29 October 2018 (UTC)
- @Insertcleverphrasehere: which particular stub templates are you thinking about? The search function relies on List of stubs, not the actual category tree. Category:United Arab Emirates stubs is in the list of stubs under Geography >> Location-specific general stubs >> Asia >> United Arab Emirates stubs. At this location in the tree, the only stub associated directly with Category:United Arab Emirates stubs is
{{UnitedArabEmirates-stub}}
(I think this is correct judging by the other entries around it). Most of the UAE stub templates are in sub-categories of UAE, but those sub categories are listed under different sections in the List of stubs. - The only ones where maybe I would expect them to show up directly at the geography location I mentioned are the upmerged templates
{{UnitedArabEmirates-org-stub}}
and{{UnitedArabEmirates-company-stub}}
. On further investigation,{{UnitedArabEmirates-company-stub}}
looks like it's correctly listed in the list of stub types at Commerce >> By country (by continent) >> Asian company stubs. However,{{UnitedArabEmirates-org-stub}}
seems like it is orphaned, as I would expect it to show up under Organizations >> Asian organization stubs, but it is not. I'll go ahead and add the organization stub. to the List of Subs. I think the current script situation means if you are expecting a certain stub template you know exists but you aren't seeing it in the search, you have to check to make sure it appears on the List of Stubs, which is why I brought up the issue of patrolling the List of Stubs at WP:Stubs. I hope I didn't misunderstand your question and explain a bunch of things you already knew. -Furicorn (talk) 22:28, 29 October 2018 (UTC)- I guess that explains why that category doesn't contain the other UAE stubs, It is a bi t confusing but something we can get used to I suppose. — Insertcleverphrasehere (or here) 07:24, 30 October 2018 (UTC)
- @Insertcleverphrasehere: which particular stub templates are you thinking about? The search function relies on List of stubs, not the actual category tree. Category:United Arab Emirates stubs is in the list of stubs under Geography >> Location-specific general stubs >> Asia >> United Arab Emirates stubs. At this location in the tree, the only stub associated directly with Category:United Arab Emirates stubs is
- @Furicorn: I meant that the other stubs are not contained inside the "United Arab Emirates" category, and should be. — Insertcleverphrasehere (or here) 10:54, 29 October 2018 (UTC)
Bug - Weird behavior encountered when trying to use "Replace All" function
[edit]Hi, I got a weird result when I tried to replace all the stubs at Oklahoma gubernatorial election, 1962. It basically didn't replace all the templates (here is the diff). Any thoughts? -Furicorn (talk) 09:17, 13 November 2018 (UTC)
It also happened at Oklahoma gubernatorial election, 1966 (https://wiki.riteme.site/w/index.php?diff=868610296&oldid=865401069 diff here). -Furicorn (talk) 09:21, 13 November 2018 (UTC)
Added request for hotcat functionality for stubs to 2019 Community Wishlist Survey
[edit]@Danski454: just wanted to let you know I made a request at the meta-wiki community wishlist survey earlier this month to create HotCat-like functionality for stub templates in case you are interested in weighing in. Maybe this request could somehow bring more collaborators to the work you've already done. -Furicorn (talk) 00:45, 19 November 2018 (UTC)
Feedback
[edit]Hello, this is a pretty interesting script. Some feedback:
- There's a bit of a wait while the script loads. The script should use caching.
- Hitting "enter" doesn't run a search. Instead, you have to click the button.
- The "Go up to" list only includes the last parent. It would be better to have the whole hierarchy there.
- The separator between items seems to be a bullet point. Consider making it an interpunct instead.
- Maybe the design could be improved to better differentiate between stub categories and the stub templates. You already have brackets around the latter, but maybe there are other things that can be done.
Opencooper (talk) 17:51, 1 March 2020 (UTC)
No button appears
[edit]Hi, I'm trying to use your script but it appears that no "stub search" button appears for me. I'm on Vector. I do have a few other scripts in my file and I'm wondering if there's a conflict maybe. User:Paradoxsociety/common.js is my file. Any advice would be greatly appreciated! Paradoxsociety 06:15, 10 May 2020 (UTC)