Edge Rewrite
Jump to content

Module talk:Goalscorers

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
(Redirected from Module talk:Goalscorers/sandbox)
Latest comment: 24 days ago by Uzume in topic newChild

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.

Johnuniq (talk) 02:35, 27 October 2024 (UTC)Reply

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)Reply

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)Reply

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)Reply
@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)Reply
@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)Reply
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)Reply
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)Reply
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)Reply
@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)Reply
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)Reply
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)Reply
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)Reply

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)Reply

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)Reply

Also, if you are concerned about post-expand include size, why are you using frame:expandTemplate with {{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)Reply
@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:newChild fix. I notice there are no Module:Goalscorers/data submodules where flag_icon_linked is not set to fbicon so 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)Reply
@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)Reply
Okay, I figured it out and deployed the change to move fbwicon and fbuicon to Module:Flagg. Hopefully nothing breaks. —Uzume (talk) 01:02, 5 July 2026 (UTC)Reply