Module talk:AfC submission catcheck
What does this module do?
Any chance of some documentation or explanation? Any links to relevant discussions would be useful. Thanks — Martin (MSGJ · talk) 08:20, 1 October 2014 (UTC)
- @MSGJ: I just added a doc page for it. Jackmcbarn (talk) 12:00, 1 October 2014 (UTC)
- Thanks — Martin (MSGJ · talk) 12:01, 1 October 2014 (UTC)
Requested move 23 June 2018
- The following discussion is an archived discussion of a requested move. Please do not modify it. Subsequent comments should be made in a new section on the talk page. No further edits should be made to this section.
No consensus to move at this time. bd2412 T 15:28, 14 July 2018 (UTC)
Module:AFC submission catcheck → Module:AFC submission check – Module does more than just check for categories. {{3x|p}}ery (talk) 17:40, 23 June 2018 (UTC)--Relisting. TheSandDoctor Talk 16:49, 1 July 2018 (UTC)
- Comment – I don't think module and template names matter much, since they are not visible to readers. And this one does not need a discussion to move it; so be bold and move it if you think that's a good idea, and if someone disagrees they'll let you know or move it back. Not worthy of a wider discussion. Dicklyon (talk) 22:53, 5 July 2018 (UTC)
- Dicklyon, we just had a huge issue with this module and Module:AfC being moved, because there are a half dozen pages and bots that use it in order to function properly that all broke. Primefac (talk) 23:02, 5 July 2018 (UTC)
- Why wasn't that mentioned in the move proposal? And what's the compulsion to move it if it causes such problems to do so? This RM is ridiculous to not spell these things out. Dicklyon (talk) 03:44, 6 July 2018 (UTC)
- Dicklyon, we just had a huge issue with this module and Module:AfC being moved, because there are a half dozen pages and bots that use it in order to function properly that all broke. Primefac (talk) 23:02, 5 July 2018 (UTC)
- The above discussion is preserved as an archive of a requested move. Please do not modify it. Subsequent comments should be made in a new section on this talk page. No further edits should be made to this section.
Template:Draft categories removes categories
@WOSlinker: I created {{Draft categories}} in May. Example use. It is not advertised anywhere and has almost no uses but I'm planning to advertise it. Can the module be coded to not add Category:AfC submissions with categories when {{Draft categories}} prevents the categories from being added? PrimeBot made an unnecessary "fix" in [1]. PrimeHunter (talk) 10:48, 30 June 2018 (UTC)
- @PrimeHunter: I've created a version at Module:AFC submission catcheck/sandbox which I think should work. Did a little bit of testing and seemed ok. Have a look yourself and see what you think. -- WOSlinker (talk) 13:05, 30 June 2018 (UTC)
- @WOSlinker: Thanks. It looks good. PrimeHunter (talk) 15:31, 30 June 2018 (UTC)
Template-protected edit request on 17 January 2019
![]() | It is requested that the semi-protected page at Module:AFC submission catcheck be created. (edit · history · last · links · transclusion count · protection log) This template must be followed by a complete and specific description of the request, that is, specify what text should be removed and a verbatim copy of the text that should replace it. "Please change X" is not acceptable and will be rejected; the request must be of the form "please change X to Y".
The edit may be made by any autoconfirmed user. Remember to change the |
Hi. I'd like to add a line to the module, to remove another false positive.
From:
tc = removeFalsePositives(mw.ustring.gsub(tc,"%[%[Category:Articles created via the Article Wizard%]%]",""))
To:
tc = removeFalsePositives(mw.ustring.gsub(tc,"%[%[Category:Articles created via the Article Wizard%]%]",""))
tc = removeFalsePositives(mw.ustring.gsub(tc,"%[%[Category:Unsuitable for Wikipedia AfC submissions%]%]",""))
This is because the category (Unsuitable for Wikipedia AfC submissions) is a part of the AfC proces, and so should not be removed as a category that a draft is in.
Thanks,
--DannyS712 (talk) 19:17, 17 January 2019 (UTC)
- For a current example of why this is needed, see Draft:Annai Flim Factorie --DannyS712 (talk) 19:17, 17 January 2019 (UTC)
- @WOSlinker: I know it's been years - but do you have any feedback on this? — xaosflux Talk 20:44, 17 January 2019 (UTC)
- While there's no harm calling removeFalsePositives twice, it only needs to be called once, so the following should do as well:
tc = removeFalsePositives(mw.ustring.gsub(tc,"%[%[Category:Articles created via the Article Wizard%]%]","")) tc = mw.ustring.gsub(tc,"%[%[Category:Unsuitable for Wikipedia AfC submissions%]%]","")
- -- WOSlinker (talk) 22:14, 17 January 2019 (UTC)
- @WOSlinker: Why does it only need to be called once and/or what purpose does having the separate function serve? --DannyS712 (talk) 22:38, 17 January 2019 (UTC)
- That function removes any html commented sections and nowiki sections from the text to look at. So once removed there is no need to call it again to remove the text since it's already gone. It's in a separate function as it's called from two separate places in the code, from with "checkforcats" and "submitted". Another option for the code is to split into 3 lines as below, which may be more readable. -- WOSlinker (talk) 23:11, 17 January 2019 (UTC)
- @WOSlinker: Why does it only need to be called once and/or what purpose does having the separate function serve? --DannyS712 (talk) 22:38, 17 January 2019 (UTC)
- -- WOSlinker (talk) 22:14, 17 January 2019 (UTC)
tc = removeFalsePositives(tc) tc = mw.ustring.gsub(tc,"%[%[Category:Articles created via the Article Wizard%]%]","") tc = mw.ustring.gsub(tc,"%[%[Category:Unsuitable for Wikipedia AfC submissions%]%]","")
- @WOSlinker: Oh, I didn't realize that the articles created via the article wizard wasn't part of the actual function, but rather just nested inline. In that case, I would agree that it should be converted to 2 lines (and then add a 3rd that I am proposing) to improve readability. --DannyS712 (talk) 00:37, 18 January 2019 (UTC)
Template-protected edit request on 18 January 2019
![]() | It is requested that the semi-protected page at Module:AFC submission catcheck be created. (edit · history · last · links · transclusion count · protection log) This template must be followed by a complete and specific description of the request, that is, specify what text should be removed and a verbatim copy of the text that should replace it. "Please change X" is not acceptable and will be rejected; the request must be of the form "please change X to Y".
The edit may be made by any autoconfirmed user. Remember to change the |
- Request 1
Purely to make the code easier to parse:
Current line 7:
return mw.ustring.gsub(mw.ustring.gsub(str, "<!--.--->", ""), ".-", "")
Replacement:
str = mw.ustring.gsub(str, "<!--.--->", "") str = mw.ustring.gsub(str, ".-", "") return str
- Request 2
Remove category declarations that are nested within {{Draft categories}}, since those don't actually categorize pages. Assuming that the above request is implemented, please add the following 2 lines directly before the "return str":
str = mw.ustring.gsub(str, "{{Draft categories.-}}", "") str = mw.ustring.gsub(str, "{{draft categories.-}}", "")
There are 2 different lines because lua is not case insensitive. To see a current example where this is needed, check out Draft:Nosheen Phoenix. As for as the specific coding above is concerned, I think that lua doesn't use {{ or }}, but if it does they should be escaped.
Note: due to the limitations of displaying "nowiki" tags, it may seem unclear why this module uses "str = mw.ustring.gsub(str, ".-", "")". The middle string is actually "<nowiki>.-</nowiki>", and I put the original in the source code of this edit request to make it easier to copy-paste.
Thanks, --DannyS712 (talk) 01:38, 18 January 2019 (UTC)