Template talk:Asbox

From Wikipedia, the free encyclopedia
Jump to: navigation, search
WikiProject Stub sorting
WikiProject icon This template is maintained by WikiProject Stub sorting, an attempt to bring some sort of order to Wikipedia. If you would like to participate, you can choose to improve/expand the articles containing this stub notice, or visit the project page, where you can join the project and see a list of open tasks.
 

Obscure errors[edit]

This fix and this fix removed these two templates from Category:Stub message templates needing attention, where they were listed under the key:

  • S: category names that don't end with "stubs"

I could not figure out why they were given this error key, or what the problem was. The way I fixed them was to find a similar template from another state that worked and model my changes after the working template. So, what exactly is the problem, and can the error key be made less obscure? Thanks, Wbm1058 (talk) 13:26, 4 January 2015 (UTC)

There was a hidden unicode character lurkin in there. See this diff and you won't notice it there either. -- WOSlinker (talk) 14:47, 4 January 2015 (UTC)
Thanks, and thanks for fixin' the rest of those! Wbm1058 (talk) 15:42, 4 January 2015 (UTC)
@Wbm1058: This kind of problem is surprisingly common, I fix several whenever I visit Category:Stub message templates needing attention. It's almost always a U+200E left-to-right mark (LRM) immediately after the word "stubs", and it happens when people copypaste the name of the stub category from somewhere else. Wikipedia has an annoying habit of sprinkling LRMs where they aren't needed, mainly on page histories (four per entry), user contrib lists (three per entry), and watchlists (five per entry), but in other places too. If you go to a page where LRMs are used, mouseover the category name just slightly too far, copy to clipboard and paste somewhere else, you might copy a LRM as well without noticing. There's one at Wikipedia:WikiProject Stub sorting/Proposals/2015/January#Cincinnati, Ohio sport stubs, immediately after "Cincinnati Reds season stubs".
Here's how to check it in a stub template. Go to this old version, click "edit", position your mouse pointer more than a character's width to the right of the text "Ohio sport stubs" and click. The cursor will appear to be positioned immediately after the word "stubs"; but press ← Backspace once - the last letter "s" is not deleted. When you find one of these "type S" problems in Category:Stub message templates needing attention, edit the stub template, and try to backspace out the last "s" of the |category= param in the above manner - if it gets removed, put it back. Do the same with |category1= and |category2= if these are non-blank. --Redrose64 (talk) 17:12, 4 January 2015 (UTC)
Thanks for the detailed explanation. I've run into these LRMs over at Wikipedia:Requested moves as well (see Wikipedia:Requested moves/Closing instructions § Bot considerations). Now I know the easy way to fix these. – Wbm1058 (talk) 17:32, 4 January 2015 (UTC)
  • @WOSlinker, Wbm1058, and Redrose64: Just updated the module so that unicode characters which that do not are not either a letter, number, punctuation, or space are removed before attempting to verify category existance/naming (though note that the unicode char are still outputted in the result just in case such cats do exist? We'll have to watch the stub message attention cat to see if a lot of templates start appearing under 'N') Thus, this 'obscure error' should no longer be an issue. See Template:Asbox/testcases#Hidden unicode char for proof of concept. (PS: Avoiding hidden unicode chars is something that would have been impossible to do in normal template code, Redrose ;) ) —CodeHydro 23:18, 30 January 2015 (UTC)
You're missing the point. There should be exact correlation between the category that is declared in the template and the true name of the category. If they don't match, it needs to be reported as an error. If one or the other is being fiddled, then errors that should be reported will not be. --Redrose64 (talk) 23:24, 30 January 2015 (UTC)
Actually, you're missing the point. I'm not removing these chars for now because I do not want it break any categories. If after a few days we find that no 'correct' categories appear under sortkey N, then this replacement will be done for the output as well. In other words, we're first testing if the category name cleaning pattern is good and won't prevent any 'proper' categories. Once we know it's safe, then we'll change the output. Also note that hidden unicode chars don't break categories anyhow. —CodeHydro 23:28, 30 January 2015 (UTC)
The job queue for the cleaning pattern update is now empty. Judging from the utter lack of false positives for 'non-existing' categories, it is evident that it is safe to implement the cleaning pattern on the output. (This should further improve performance as it saves the MediaWiki engine the effort of performing the clean). I will implement the update in a few hours after I've completed testing for another module on which Asbox is dependent. (Planning to synchronize the updates to minimize double-updates on the same pages.) —CodeHydro 20:26, 3 February 2015 (UTC)
@Codehydro: I agree with Redrose64. The removal of characters should be reverted. Jackmcbarn (talk) 23:32, 8 February 2015 (UTC)
@Jackmcbarn: I don't think Redrose64 is opposed to the removal of hidden unicode from output. I believe his concern was regarding a mismatch between output and error sorting, which was done only for the sake of testing the cleaning pattern's safety. (By doing the cleaning after output, inappropriate char removal would only cause temporary false positives in the stub error category but leave articles unaffected). No such false patterns occurred and thus the pattern is determined to be safe. The recent bug involving non-categorization is unrelated. —CodeHydro 23:55, 8 February 2015 (UTC)

Prevent categorization in user sandboxes?[edit]

It seems that there has recently been an explosion of stub templates listed on Wikipedia:Database reports/Polluted categories. Would it be possible to update this template so that stub templates only add categories in mainspace, and not in userspace? Thanks! GoingBatty (talk) 03:39, 7 February 2015 (UTC)

It is true that pre-Luaisation, the Asbox template would only categorise (into Category:All stub articles plus the cats defined by |category= |category1= |category2=) when used in mainspace; however, the recent change to this behaviour has enabled me to detect misuse, as with these ten bot edits. --Redrose64 (talk) 13:20, 7 February 2015 (UTC)
Then we'll need to add {{polluted category}} to all the stub categories to make Wikipedia:Database reports/Polluted categories usable again. Before I submit an RFBA, does anyone have a bot already approved to do this? Thanks! GoingBatty (talk) 15:55, 7 February 2015 (UTC)
I have a fix ready for this. Just doing a little more testing before I release it. I apologize for any inconvenience as I failed to anticipate userspace articles when coding the module. It will take a few days to a week for the patch to reach every userspace page due to the high number of transclusions. —CodeHydro 23:16, 7 February 2015 (UTC)
That last sentence is a fair description of pages being put in the job queue. --Redrose64 (talk) 00:12, 8 February 2015 (UTC)

Misuse on categorry pages can be found with this. -- WOSlinker (talk) 13:09, 8 February 2015 (UTC)

I have reverted Codehydro's patch, as it prevents ctegorization from articles, too. There's no need for a bot to add {{polluted category}} to all the stub categories - I did it with one edit. עוד מישהו Od Mishehu 13:28, 8 February 2015 (UTC)
  • Brought the patched patch back. Basically, the module has two functions that deal with categories: one that find the category parameters, and one that outputs the categories. Long story short, I moved the 'find' function so that it would only be executed in in article space, but in trying to move the 'output' function to a place unreadable by user space, I failed to place it in a position that would be executed in article space. A single misplaced line of code that wasn't caught in tests since all testcases were in template space, which was obviously unaffected by my actions for article/user space. I've created new tests to prevent bugs like this from slipping through the cracks in the future. —CodeHydro 14:20, 9 February 2015 (UTC)
@Od Mishehu and Codehydro: There are still over 100 stub categories showing up on Wikipedia:Database reports/Polluted categories. Are there any other actions that should be taken to prevent this? Thanks! GoingBatty (talk) 03:01, 28 February 2015 (UTC)
@GoingBatty: Well, the job queue is fully cycled but looks like a few categories got left behind. There isn't really anything that can be done from Module:Asbox. For example [1] shows User:Revjlamont in the list, even though the user page itself does not show the category. All you can do is null edit user pages in each polluted category, perhaps via a bot —CodeHydro 03:16, 28 February 2015 (UTC)
@Legoktm and Joe Decker: Would either of you be willing to run your null edit bot over these user pages to fix the incorrect categorization? Thanks! GoingBatty (talk) 03:46, 28 February 2015 (UTC)

Extra line break in the text displayed by some stub templates[edit]

Is the recent Lua-ization of this template responsible for the extra line break in the text displayed by some stub templates, such as those on Bop (magazine)? Thanks! GoingBatty (talk) 21:05, 8 February 2015 (UTC)

I see that both of those stub templates ({{Entertainment-mag-stub}}, {{Teen-mag-stub}}) use the |note= parameter, which is unusual: there aren't many stub templates that have that. Have you come across the problem on any that don't use |note= ? --Redrose64 (talk) 21:14, 8 February 2015 (UTC)
@Redrose64: I checked many other pages with stub templates, and didn't find any other examples. I did see that {{Mag-stub}} (on Gala (magazine)) uses the |note= parameter and looks fine - maybe the text is just a little shorter so it doesn't need to wrap? GoingBatty (talk) 02:39, 9 February 2015 (UTC)
For me, there is no wrapping in either one. I do see a larger gap - which might be a blank line - at Bop (magazine) that isn't there on Gala (magazine). I notice that {{Mag-stub}} has an image, the other two don't. I don't even know why I'm bothering investigating this, since it clearly worked before Lua-isation - I do not understand Lua code one bit, and I'm not the only one. I vote that we put the template back to exactly how it was before. It worked, and more importantly we knew how it worked, and there was nothing wrong with it that we couldn't handle ourselves. There should be a demonstrable need to convert to Lua, and I see nothing above that shows that there is any need at all. --Redrose64 (talk) 11:58, 9 February 2015 (UTC)
  • Just click this link if you want to see exactly how Bop (magazine) would have been rendered with the pre-Lua Asbox (for a quick comparison, just blank the Sandbox prefix field to see Lua version). As far as I can see, the output is identical (other than the pre-Lua version having slightly slower stats on the bottom) —CodeHydro 14:00, 9 February 2015 (UTC)
I've viewed the output in both Firefox & IE, and it's only going on two lines for Firefox. So appears to be a layout bug in Firefox. There is a slight difference, in the lua version, the br is inside the span tag and outside in the non-lua version. -- WOSlinker (talk) 15:48, 9 February 2015 (UTC)
See this screenshot. The upper half is Bop (magazine), the lower half is this link. Notice that although the gap between the templates (ringed in blue) is exactly the same, the gap within the templates (ringed in red) has increased by 20px. You should also see that there is no word-wrapping. Firefox 35.0.1 --Redrose64 (talk) 16:06, 9 February 2015 (UTC)
  • Thanks for the screenshot! It's fixed now. Yeah, bloody non-standard Firefox... even very old versions of I.E. don't break that way. What happened was that I had moved a BR tag from in front of the note span tag to inside as the first item of the span for the sake of streamlining the code. Tested in at least 3 browser environments and none presented that bug, but I guess should have tried FF. Good job! (PS: One good thing that came out of the Firefox bug is that the Module is even faster than before. The part that connected to the bug was written months ago when I had a lot less experience with Module codes, so it was good to revisit it.) —CodeHydro 20:46, 9 February 2015 (UTC)
Thanks to everyone who worked on this - it looks much better in Firefox 35.0.1 now! The lesson for me is that I should check multiple browsers and report which ones I'm using. GoingBatty (talk) 01:29, 10 February 2015 (UTC)

Template-protected edit request on 23 August 2016[edit]

"Herry Tangiri" Name Correction Ankitszone (talk) 20:51, 23 August 2016 (UTC)

Note: Yes, the name was incorrectly spelled in the article M.S. Dhoni: The Untold Story, and thank you for catching that, but what makes you think something in this template needs to be changed?  Rules of enpagement Paine  21:32, 23 August 2016 (UTC)