Module talk:Goalscorers
Add topic| This module does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||
| ||||||||
Bad argument to formatNum
[edit]Some recent changes have led to "Lua error: bad argument #1 to 'formatNum' (number expected, got nil)" in several articles. I have only looked at a couple of these but it appears that use of assists=yes causes Module:Goalscorers#L-900 to give an error. I don't know what should be done but could offer some opinions on giving a more helpful error message if assists should be a number. I think these need fixing, and maybe some more from here.
- 1991 FIFA Women's World Cup
- 1995 FIFA Women's World Cup
- 1999 FIFA Women's World Cup
- 2007 FIFA Women's World Cup
- 2011 FIFA Women's World Cup statistics
- 2015 FIFA Women's World Cup
- 2015 FIFA Women's World Cup statistics
- 2017 FIFA Confederations Cup statistics
- 2019 FIFA Women's World Cup statistics
- 2020 NWSL Challenge Cup
- 2023 FIFA Women's World Cup
- Football at the 1996 Summer Olympics – Women's tournament
- Football at the 2000 Summer Olympics – Women's tournament
- Football at the 2004 Summer Olympics – Women's tournament
- Football at the 2008 Summer Olympics – Women's tournament
- Football at the 2012 Summer Olympics – Women's tournament
- Football at the 2016 Summer Olympics – Women's tournament
Johnuniq (talk) 02:35, 27 October 2024 (UTC)
- I think it is fixed now. That particular variable is only used with goals (which is a number). — Jts1882 | talk 09:16, 27 October 2024 (UTC)
Table error
[edit]In the page of top goalscorers in the promotion-relegation playoffs in 2024-25 UEFA Nations league, the table is not displayed correctly. Giorgiov16 (talk) 19:58, 23 March 2025 (UTC)
- Specifically, the table at 2024–25 UEFA Nations League#Top goalscorers 5 duplicates the line showing 33 players with 1 goal scored. There was a single own goal during the play-offs, but that should not be affecting the table. I remember an issue from October as a result of all scorers having scored only 1 goal, so I wonder if this is associated with that somehow. — Jkudlick ⚓ (talk) 23:14, 23 March 2025 (UTC)
- @Giorgiov16: I think it should be displaying properly now. The fix for the issue from October inadvertently caused the last goalscorers in the table to be repeated if they were on one goal. — Jkudlick ⚓ (talk) 23:53, 23 March 2025 (UTC)
- @Jts1882: I have tried to figure out why the League D table lists each one-goal scorer rather than "15 players" to no avail. You can review my efforts in the module sandbox to see what I'm missing. — Jkudlick ⚓ (talk) 01:41, 24 March 2025 (UTC)
- It's a long time since I wrote the code and I can't remember the full logic, which makes me wary of making changes that could have effects elsewhere. I can't see an easy way of doing what you want. There could be an easy way I'm missing or it might need an additional counter. I'll have another look later, but can't promise anything. — Jts1882 | talk 12:01, 27 March 2025 (UTC)
- I think this edit does what is required. It needs refining (the formatting, etc) and testing for unexpected results. [edit: there are some additional tests included which shouldn't be used in a live version] — Jts1882 | talk 19:33, 27 March 2025 (UTC)
- I've added the properly formatted version to the sandbox. I tested it on 2024–25_UEFA_Nations_League using the edit preview and it shows a single row with the number of players if the number of players on one goal is more than ten. Perhaps you can check some of the testcase pages for any problems. — Jts1882 | talk 09:02, 28 March 2025 (UTC)
- @Jts1882: I can't seem to make it work correctly; League D still lists the 15 players who scored one goal. It seems a rather fringe case, so it's not such a big deal that we need to continue trying to figure it out. I'm just afraid that if we keep trying to fix this one unexplainable glitch that we will end up breaking something else. Thanks for the effort. — Jkudlick ⚓ (talk) 16:47, 6 April 2025 (UTC)
- It works for me with this edit. But I agree that the risk of unintended consequences for an edge case is not worth it. — Jts1882 | talk 17:05, 6 April 2025 (UTC)
- I figured out the error, it was a PICNIC – Problem In Chair, Not In Computer. I was previewing a live page from the sandbox, but of course the live page used the live module and not the sandbox. Your edits work perfectly well and don't seem to affect anything else. — Jkudlick ⚓ (talk) 01:26, 7 April 2025 (UTC)
- Yes, it's easy to find yourself struggling with a problem because you're not actually testing the change. When we wrote this module, lots of testcases were set up to use the sandbox, but I can't remember all nuances. — Jts1882 | talk 08:35, 7 April 2025 (UTC)
- I figured out the error, it was a PICNIC – Problem In Chair, Not In Computer. I was previewing a live page from the sandbox, but of course the live page used the live module and not the sandbox. Your edits work perfectly well and don't seem to affect anything else. — Jkudlick ⚓ (talk) 01:26, 7 April 2025 (UTC)
- It works for me with this edit. But I agree that the risk of unintended consequences for an edge case is not worth it. — Jts1882 | talk 17:05, 6 April 2025 (UTC)
- @Jts1882: I can't seem to make it work correctly; League D still lists the 15 players who scored one goal. It seems a rather fringe case, so it's not such a big deal that we need to continue trying to figure it out. I'm just afraid that if we keep trying to fix this one unexplainable glitch that we will end up breaking something else. Thanks for the effort. — Jkudlick ⚓ (talk) 16:47, 6 April 2025 (UTC)
- It's a long time since I wrote the code and I can't remember the full logic, which makes me wary of making changes that could have effects elsewhere. I can't see an easy way of doing what you want. There could be an easy way I'm missing or it might need an additional counter. I'll have another look later, but can't promise anything. — Jts1882 | talk 12:01, 27 March 2025 (UTC)
- @Jts1882: I have tried to figure out why the League D table lists each one-goal scorer rather than "15 players" to no avail. You can review my efforts in the module sandbox to see what I'm missing. — Jkudlick ⚓ (talk) 01:41, 24 March 2025 (UTC)
- @Giorgiov16: I think it should be displaying properly now. The fix for the issue from October inadvertently caused the last goalscorers in the table to be repeated if they were on one goal. — Jkudlick ⚓ (talk) 23:53, 23 March 2025 (UTC)
Use of boldface
[edit]Why is boldface used to emphasize players that remain active in the tournament? This appears to go against MOS:NOBOLD. Renerpho (talk) 13:55, 27 June 2026 (UTC)
newChild
[edit]@S.A. Julio: What's up with your change that uses
frame:newChild? Why not instead just use: result = require('Module:Flagg').luamain(frame, args). I do not know enough about this module to test it but I put that change in the sandbox. Please use that if it work. Thanks, —Uzume (talk) 09:40, 3 July 2026 (UTC)
- Also, if you are concerned about post-expand include size, why are you using
frame:expandTemplatewith{{icon}}? Why not just use:require('Module:Icon')._main{ level, country, flagVariant or "" }as is documented at Module:Icon#From Lua? I put that change into the sandbox too. —Uzume (talk) 10:01, 3 July 2026 (UTC) - @S.A. Julio: Okay, I found the testcases and realized my last comment was wrong and I had a typo in the first one. Anyway, based upon the testcases, I deployed the
luaMain/non-frame:newChildfix. I notice there are no Module:Goalscorers/data submodules whereflag_icon_linkedis not set tofbiconso that branch of the code I left untouched since I do not see how it gets activated just now. Hopefully there are no issues. —Uzume (talk) 22:57, 4 July 2026 (UTC)- @S.A. Julio: Okay, I see the other possibilities are:
{{fbwicon}}and{{fbuicon}}. Can those be converted to "fbicon" somehow? I notice some of the flags are very slightly different in size and the link is different. See: fbwicon search and fbuicon search. —Uzume (talk) 00:02, 5 July 2026 (UTC) - Okay, I figured it out and deployed the change to move
fbwiconandfbuiconto Module:Flagg. Hopefully nothing breaks. —Uzume (talk) 01:02, 5 July 2026 (UTC)
- @S.A. Julio: Okay, I see the other possibilities are: