Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Search
Search
Appearance
Create account
Log in
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Editing
Module talk
:
Coordinates
(section)
Add topic
Module
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
Add topic
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Edit request 11 January 2026 == {{FPER|answered=yes}} Please copy [[Module:Coordinates/sandbox]] to [[Module:Coordinates]]. See {{Compare pages|Module:Coordinates|Module:Coordinates/sandbox|label=diff}} for the code changes. The function coord2text is not protected against garbage inputs. See, for example, the third-to-the-last [[Module talk:Coordinates/testcases#test_coord2text|test case for coord2text]]. The "expected" box is a Lua error, which happens when {{para|type|long}} is applied to a junk string. I added checks in coordinates._coord2text() to return nil if something went wrong, then checked for nil in coordinates.coord2text() and returned a blank string on failures. The tests pass for the sandbox (except where it fixes the Lua error, above). Thanks for your attention! β [[User:Hike395|hike395]] ([[User talk:Hike395|talk]]) 21:04, 11 January 2026 (UTC) : Why is this necessary? Why isn't producing an error the correct behavior when given garbage input? [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun...</sub>]] 19:31, 13 January 2026 (UTC) ::{{ping|Pppery}} The current module does not produce an error for any non-longitude call to coord2text() with junk arguments. It produces an obscure Lua error if junk is passed into longitude. This is not consistent. Following the [[principle of least astonishment]], I thought it would be better if longitude were consistent with the other parameters. If you want, we can raise a preview warning in coordinates.coord2text(), but I have been previously shouted at about putting technical preview warnings into articles themselves. β [[User:Hike395|hike395]] ([[User talk:Hike395|talk]]) 21:21, 24 January 2026 (UTC) ::Later --- [https://en.wikipedia.org/w/index.php?limit=100&fulltext=1&ns10=1&profile=advanced&search=insource%3A%22coord2text%22&title=Special%3ASearch usage] of coord2text() from templates shows that coord2text isn't generally being used to create reader-visible text, but for logic within infoboxes. We could throw hard errors in all of these cases, but it might break infoboxes and be disruptive. I think silently failing at this point is a better option. β [[User:Hike395|hike395]] ([[User talk:Hike395|talk]]) 21:30, 24 January 2026 (UTC) ::In the proposed change, callers from modules will receive nil upon error, which is the standard method --- module callers can decide how to handle the nil case, or if they haven't thought about it, will generate an error in the calling module. The proposed edit thus improves error handling in this case. β [[User:Hike395|hike395]] ([[User talk:Hike395|talk]]) 21:30, 24 January 2026 (UTC) ::: {{Done}} [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun...</sub>]] 20:36, 25 January 2026 (UTC)
Summary:
Please note that all contributions to LarpOfHoi4 Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
LarpOfHoi4 Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Module talk
:
Coordinates
(section)
Add topic