Module talk:Location map

From Wikipedia, the free encyclopedia
  (Redirected from Template talk:Location map)
Jump to: navigation, search

Add overflow=hidden property by default[edit]

Please see Template:Location_map+/testcases#Overflowing_labels_.7C_overflow.3Ddefault. I've made a small addition to Template:Location map+/sandbox that sets by default the overflow:hidden CSS property on the map container. This should fix the minor but annoying layout bug on articles such as Caterham and Oxted (links to versions that show the bug), where an overflowing map label causes a horizontal scrollbar to appear in the browser (I've wondered since March what was messing the page layout on Caterham, and now finally found it.) To fulfill the request, simply copy&paste the content of Template:Location map+/sandbox to Template:Location map+. Thanks, --hydrox (talk) 01:24, 2 December 2013 (UTC)

Done. Thanks for the fix! — Mr. Stradivarius ♪ talk ♪ 02:22, 2 December 2013 (UTC)
Please revert and discuss, it is better to have overflowing text than hidden text. If the problem is solely due to the map pushpin label overflowing the right-hand edge of the map, the solution is simple - reposition the label. In the case of pages using {{infobox UK place}}, such as Oxted, you would do this. --Redrose64 (talk) 10:52, 2 December 2013 (UTC)
It's anyway a bad idea to have relatively positioned block elements floating around the page, as those can cause strange rendering issues. Setting overflow:hidden on the container gets rid of those. I would first like to see a concrete example where this causes any issues, other than making editors aware that there are labels in the location map that should be maybe aligned differently. --hydrox (talk) 22:06, 2 December 2013 (UTC)
Wikipedia Rollbacker.svg Reverted, please continue the discussion. — Martin (MSGJ · talk) 12:53, 3 December 2013 (UTC)
So this was essentially rejected – instead of actually engaging in a discussion and addressing my points User:Redrose64 has disappeared after the complaint? --hydrox (talk) 17:35, 5 December 2013 (UTC)
No, I've not disappeared. I've already indicated that the problem may be overcome using existing methods - the |label_position= parameter; you yourself have used them. I'm waiting for other people to demonstrate that overflow:hidden; is a good idea, per WP:BRD and WP:CON. --Redrose64 (talk) 17:40, 5 December 2013 (UTC)
Well, there can not be consensus for introducing something entirely novel (there are zero hits in this page's archives for "overflow"). And people will not know to come discuss here if there's nothing broken. But I am okay with holding this change at least until I am next time annoyed by randomly appearing scroll bars in the page. --hydrox (talk) 18:01, 5 December 2013 (UTC)
It looks to me like the real problem isn't this template, but {{Infobox UK place}}. That template specifies a default |label_position=right if one isn't explicitly specified, when really it shouldn't specify a default at all and allow this template to supply its own default. I believe this template automatically puts labels on the east side of the map on the left instead of the right, if not overridden. -- Dr Greg  talk  19:21, 5 December 2013 (UTC)
Note to all page-watchers. This template has been converted to Lua, and so its code can no longer be understood. I shall therefore cease offering assistance in the use of this template, and will unwatch this page: consequently, my comment "I've not disappeared" of 17:40, 5 December 2013 no longer holds true. --Redrose64 (talk) 21:17, 13 March 2014 (UTC)
How does Lua mean its code can no longer be understood? Lua let the code be simplified from its original form. Jackmcbarn (talk) 21:22, 13 March 2014 (UTC)

New USA Southeast Location Map[edit]

Can anyone help with creating a location map for the Southeast of the United States. I've been trying to find a map of the Southeast US and have been unable to. The map would include: Washington DC, Virginia, West Virginia, Kentucky, Arkansas, Tennessee, North Carolina, South Carolina, Georgia, Florida, Alabama, Mississippi and Louisiana. It can include parts of other states obviously but the idea would be for it to be about the bottom quarter of the normal USA Location Map. I've tried creating one but have failed. Thanks. Mak888 (talk) 02:57, 12 January 2014 (UTC)

do you have an image uploaded? if you upload a cropped version of the main one, I can help with the parameters. Frietjes (talk) 16:35, 13 January 2014 (UTC)
I wasn't sure if that would make it more difficult since you wouldn't have the original dimensions. If you took literally split the USA location map in 4 parts and took the bottom right hand corner that should work or be close, may needs to be a little farther north. I only have paint on my computer so can't do much. Mak888 (talk) 22:18, 14 January 2014 (UTC)
I'm in the same situation, but will have access to something better this weekend. just to double check, do you want all the states in dark red shown in Southeastern United States, or the ones in lighter red as well? Frietjes (talk) 22:22, 14 January 2014 (UTC)
hey sorry forgot about this, could use all the ones color, both light and dark red. thanks Mak888 (talk) 05:01, 7 February 2014 (UTC)
if you can have someone help you make cropped versions of the two maps in Template:Location map USA and upload them, I can relatively easily make the new location map. whoever crops the images should keep track of exactly how many pixels were cropped off each side of the image. I can do it, but I will need to install inkscape to do it properly. you might be able to find someone to help you faster at Wikipedia talk:Graphics Lab/Map workshop. Frietjes (talk) 14:24, 7 February 2014 (UTC)

Transcluding missing modules[edit]

can we fix Special:WhatLinksHere/Module:Location map/data/Africa and similar (currently redlinked modules) in the new module version? if not, we should revert to the old version. Frietjes (talk) 13:27, 14 March 2014 (UTC)

also, if the plan is to simply create these missing modules, we need to have a plan for how we preserve attribution when the are copied. Frietjes (talk) 13:34, 14 March 2014 (UTC)
The way the code works is it tries to transclude Module:Location map/data/whatever, and if it fails, it uses Template:Location map whatever instead. This seems fine to me, and I'm not sure why it would need to be changed. Is there a concern with transcluding nonexistent modules? Jackmcbarn (talk) 15:45, 14 March 2014 (UTC)
a few questions: (1) where was the switch to lua and new code design discussed? (2) if there is no answer for question 1, then where is the performance comparison between the old and new version? (3) if there is no answer for question 1, what are the benefits for switching to lua? (4) does the new module strip spurious whitespace in multiple-pin invocations, (5) what happens if an editor sees a redlinked module, clicks on it, and creates something non-functional? or have all the location maps been converted and given the same protection level as the templates? (5) why were some templates moved to an attribution page without redirect, and others with redirect? Frietjes (talk) 15:57, 15 March 2014 (UTC)
1. It wasn't. 2. The new code is about 3 times as fast (Template:Syrian civil war detailed map went from about 30 seconds render time to about 10). 3. Mainly performance, also cleaner code. 4. I'm not sure what you're asking. Can you give me an example? 5. That is a concern. Right now, that could cause damage. I'll work on a solution to that. 6. None of them should have redirects. I tagged most of them for deletion, but I may still have some more to do. Jackmcbarn (talk) 16:22, 15 March 2014 (UTC)
I am definitely concerned that this was not discussed prior to rolling it out. There should be at least the appearance discussion before changing such widely used templates. Transcluding missing templates is also a concern, we should do something about this. Plastikspork ―Œ(talk) 21:12, 15 March 2014 (UTC)
With regard to item 4, see this thread above. We should not orphan the redirects in the near term, unless they have zero transclusions. Just my 2 pence. Plastikspork ―Œ(talk) 21:15, 15 March 2014 (UTC)
They have 0 transclusions. The job queue just hasn't caught up yet. Re 4, blank lines do break it, but since they broke it before, I'm not overly concerned right now (though I can fix that easily now). Regarding transcluding missing things, if needed, I can change the code to do an equivalent of a #ifexist before trying to load, but what's the benefit of that? Is there a database report containing redlinked templates that this is filling up? Jackmcbarn (talk) 21:19, 15 March 2014 (UTC)
Note, 0 transclusions in article space is not the same as 0 transclusions. Yes, there is a database report for redlinked templates that this is filling up. The benefit of an ifexist check would be to not transclude missing modules. I thought that much was clear in the thread above :) Plastikspork ―Œ(talk) 21:37, 15 March 2014 (UTC)
Okay, it doesn't transclude missing modules anymore. Jackmcbarn (talk) 23:10, 15 March 2014 (UTC)

"Script error"[edit]

The article List of National Trust properties in Somerset uses Location map+ and has previously worked fine. It is now showing script error and I can't work out why. If anyone had any ideas (or fixes) that would be great.— Rod talk 18:26, 15 March 2014 (UTC)

You had a typo in the template call. I fixed it. Jackmcbarn (talk) 19:25, 15 March 2014 (UTC)
Thanks - I think this must have been introduced when someone used AWB to fix some citations etc which may have removed the "|" between Somerset & label. I had stared at it for ages & not spotted that.— Rod talk 19:30, 15 March 2014 (UTC)

Another script error is showing up on Yorkshire and the Humber (European Parliament constituency). If someone could take a look. Thanks. Keith D (talk) 20:20, 20 March 2014 (UTC)

fixed. Frietjes (talk) 20:36, 20 March 2014 (UTC)
Thanks for quick response. Keith D (talk) 20:58, 20 March 2014 (UTC)

Help with Sevastopol's location map[edit]

I can't get the coordinates right for {{Location map Sevastopol}}

When I place the pins they are either too far east or too far north.

Can someone help please?

Ahnoneemoos (talk) 17:19, 29 March 2014 (UTC)

  • @Ahnoneemoos: New location maps should be created as modules rather than templates (see Template:Location map/Creating a new map definition for details). Anyway, are you sure the image you're using is an equirectangular projection? Jackmcbarn (talk) 01:29, 30 March 2014 (UTC)
  • The image's author doesn't know whether or not it's equirectangular. Since it's been giving you so many problems, chances are that it's not. Only equirectangular projections work with location map unless you know the exact equations for the projection used, unfortunately. Jackmcbarn (talk) 01:37, 30 March 2014 (UTC)
  • Anyone can make them. Just make sure you specify it has to be equirectangular when you ask for it. (And can you {{db-g7}} the template and restart it as a module?) Jackmcbarn (talk) 01:55, 30 March 2014 (UTC)

Location_map templates deleted[edit]

Several admins circa 15 March 2014 have deleted some of the nation/region templates of Template:Location_map (changed to use Lua modules), which might be needed to format prior revisions of pages with maps. Specifically:

Various admins have deleted/moved those templates and /doc subpages. In particular, Template:Location_map_Italy/doc needs to be unmoved or undeleted. There might be other mapper templates which were also deleted. The migration of {Location_map} to Lua has caused problems of "Script error, and is not portable to all browsers. Remember, Lua errors do not kill an entire article, but kill the whole template, whereas markup-based templates could display partial results (such as a map with error message for the user, but Lua shows "Script error" and no clue why). Currently, Template:Location_map_all is/was the faster, portable template to quickly display maps in rectangular coordinates on any browser, but it uses the map helper templates. -Wikid77 (talk) 15:19, 6 April 2014 (UTC)

Why do those need to be undeleted exactly? What articles specifically have script errors because of the Lua migration? Template:Location_map_all was moved to sandbox as a result of TfD. Those old templates are unused and should stay that way. Any benefits of any of your several forks of this template can and should easily be applied to the module, though I still have yet to see one that's not already applied. Jackmcbarn (talk) 15:54, 6 April 2014 (UTC)
To the reason given in the first sentence there is no need to 'format prior revisions'. I understand what you mean - as templates, categories, images are moved, renamed and deleted there's no way to fix old revisions of articles that still include the old versions. But that is not a problem we should be trying to solve as it's essentially unsolvable. The revisions primarily exist for attribution, as when you look at the diffs of an editors contributions or a page history you need both versions of the article to diff. They are also occasionally useful for content, such as content that was deleted for lack of notability but sources can now be found. But these previous revisions aren't meant to be read as articles, and expending effort fixing problems with them is essentially wasted effort as most problems can't be fixed so they'll never be of article standard.--JohnBlackburnewordsdeeds 16:09, 6 April 2014 (UTC)
Further, the claim that previous revisions break at all is completely wrong. Old revisions of pages use the latest revision of Template:Location map, not the version that existed when they were saved, so the module data works fine with them. Jackmcbarn (talk) 16:13, 6 April 2014 (UTC)
The prior page revisions which use Template:Location_map_all will break when the helper templates have been deleted. You obviously do not understand the situation, and you need to stop deleting templates which have been developed over the past 8 years. Perhaps 8 years from now, you will have a better understanding. -Wikid77 (talk) 16:35, 6 April 2014 (UTC)
Then we can recreate Template:Location_map_all as a redirect to Template:Location_map_many for the very few pages that ever used that. And besides, as JohnBlackburne said, it's not a big deal if they break. Jackmcbarn (talk) 16:45, 6 April 2014 (UTC)
And don't say I'm deleting templates. Your templates were deleted because consensus at TfD was to delete them. The community deleted them. Jackmcbarn (talk) 16:46, 6 April 2014 (UTC)
I understand it perfectly well, as I made clear in my first reply. As I explained 'fixing' old revisions is not possible and not something editors should waste time on. Articles, images, categories, are deleted or moved without redirect every day. We fix problems this causes in live articles, but can't fix old articles. This is in some ways a feature: the red links help remind readers, if they stumble on an old revision as they're sometimes linked, that the page is out of date. They can also follow the redlink to read the log entry to see why, use 'What links here' to find any discussion or notice, often (in the case of the template) the current alternative they should be using.--JohnBlackburnewordsdeeds 16:48, 6 April 2014 (UTC)

@Jackmcbarn, Wikid77, JohnBlackburne: Jackmcbarn has asked me to look into this dispute as a neutral third party. I can see several points under discussion here, but in situations like this I've found that it's easiest to deal with one thing at a time. So let's start with the thing that I thought stood out the most - the question of whether the Lua migration of {{Location map}} generated script errors. Obviously, we want to avoid script errors. But equally, we shouldn't avoid using Lua because of the mere possibility that script errors might occur. There are various ways of avoiding script errors, and to me it seems premature to stop using Module:Location map without considering any of them. Wikid, is it just the possibility of generating script errors that you are worried about, or did you actually see script errors generated on any pages? Were those script errors in the current revisions of those pages, or were they in previous revisions? Once we are sure of the facts here, I think it will be a lot easier to deal with the rest of the points that have been raised. Best — Mr. Stradivarius ♪ talk ♪ 10:52, 7 April 2014 (UTC)

With several related issues, I agree it would be better to discuss each issue as separate threads below:
          • "#Avoiding script errors"
          • "#Support for any browser"
Reply at each thread. -Wikid77 17:10, 7 April 2014 (UTC)

Avoiding script errors[edit]

I see Jackmcbarn has been writing Module:Location_map, and I had not viewed the source code earlier. I think we need to check calculations and invalid numbers in the lat_deg & lon_deg parameters, without showing script error (which has been fatal to omit the entire map, with no warning messages to the user). A possibility would be to attempt to auto-correct invalid digits, or assume an invalid latitude (or longitude) is the mid-point between the map's extreme values. To just show "Script error" would be much worse than a map with an invalid-expression message, and it would be good to alert the user with the caption, "[fix latitude]" or such in the map's caption. Compare results of templates below.

Example of Imotski in Croatia
{{Location map | Croatia
| lat = 43.44 | long = 17.21 | label = Imotski
  | position = right
  | background = #FFFFDD
| width =180 | float = left | marksize=4
| caption = Imotski {Location map}
| alt = Imotski is in Croatia.
}}
Result from {Location map}   
Imotski is in Croatia.
Imotski is in Croatia.
Imotski
Imotski {Location map}
Result from {Location map quick}
</noinclude>
Imotski (Croatia)
Imotski
Imotski
in {Location map quick}


Test invalid data "long = 17.x".
Result from {Location map}   

Script error

Result from {Location map quick}
</noinclude>
Imotski (Croatia)
<div style="position:absolute; z-index:2; top: 70.9%; left: Expression error: Unrecognized word "x".%; height: 0; width: 0; margin: 0; padding: 0;">
Imotski
Imotski
in {Location map quick}

The original operation, from years ago, was to warn the user when invalid coordinates were entered, but those messages were omitted in various mapper templates. -Wikid77 17:10, 7 April 2014 (UTC)

Yes, one shows Script Error, the other an error. But click on Script Error and you see the error in a popup, with a precise error and stack trace, much more useful for tracking down the problem. Mostly though for ordinary editors either works to let them know there's a problem and to check the parameters. Editors aren't expected to know Lua debugging or parser error parsing (and parser functions often don't produce an explicit error, they just show the wrong thing). For most the best thing is point out there's an error to get them to check the parameters. For technical editors and those actually testing the stack trace is far the more useful of the two.--JohnBlackburnewordsdeeds 17:24, 7 April 2014 (UTC)
Thanks for the reply. It is certainly possible to generate a more meaningful error message in this situation. For example, we could check whether the longitude variable exists before we do any arithmetic on it, and if it doesn't exist we could raise an error like 'longitude value "17.x" is not a valid number'. If we want, we could also make this a wikitext error rather than a script error, although that may require some re-engineering of the module. Wikid, would you be satisfied with a script error that contains a more informative error message after you click it, or would you prefer that the error message be a wikitext error? — Mr. Stradivarius ♪ talk ♪ 18:36, 7 April 2014 (UTC)
I think any use of "Script error" (even if linked to Lua diagnostics) would be trouble for the end-users, so I suggest to use autofixing of invalid parameters, to display a map with partial marker data; see below: "#Autofixing map parameters". -Wikid77 05:21, 8 April 2014 (UTC)

Autofixing map parameters[edit]

A map marker can be autofixed to overcome some cases of invalid latitude, longitude or other parameters, as "robust" operation. Showing an invalid map as "Script error" is likely to confuse the end-users, especially if the invalid map data was an accidental "drive-by" glitch by another user who intended to change some other part of the page, but mistakenly botched the map parameters. The goal is to show the map with an autofixed marker, if possible, where even a newcomer might be able to write a nearly correct map, while not understanding the exact parameters to align markers "perfectly" with labels.

The example below shows a proposed {{Location_map/new2}}, where the invalid longitude "17.x" is auto-trimmed to "17." to show the map marker, slightly off-course, and avoid "Script error" caused by "tonumber(degree)" returning "nil" for invalid numbers.

Example of Imotski in Croatia
{{Location map | Croatia
| lat = 43.44 | long = 17.x | label = Imotski
  | position = right
  | background = #FFFFDD
| width =180 | float = left | marksize=4
| caption = Imotski {Location map}
}}


Test invalid data "long = 17.x".
Result from {Location map}   

Script error

Autofixed in {Location map/new2}
Imotski is located in Croatia
Imotski
Imotski
in {Location map/new2} [fix long=17.x]

In the above example, the invalid data "17.x" is auto-corrected as just "17." with the superscript note "[fix long=17.x]" to remind the user of the problem. In general, I think invalid numbers could be autofixed digit-by-digit (by Lua gsub()?), such as replace letter "o" as digit zero "0" or letter "i" as digit one "1" or perhaps letter "x" as "5" then check the result against the map's edges for the valid range of longitudes, and when an autofixed number is outside the range, then use range/2 to autofix an invalid coordinate as half-way (center) of the specific map, plus show "[fix__]" in the map's caption. A previous common glitch in many maps for the past 8 years has been invalid "px" in "width=180" but {Location map} already autofixes "180px" as being valid "180" while "width=180x" would show fatal Script error, and could be autofixed as "180" or default "200" when the "width=#$%" cannot be deciphered. Because Lua is so fast, then autofixing can be run in a tiny fraction of a second while adjusting several parameters. -Wikid77 05:21, 8 April 2014 (UTC)

I think that type of autofixing would be a little bit too aggressive. I'd rather strip out everything except numbers, "-", and ".", then parse whatever's left as a number. Jackmcbarn (talk) 12:39, 8 April 2014 (UTC)
The live errors also crashed on "long=−0.5" with the true minus-sign character for &minus ('−') causing Script error with tonumber(). -Wikid77 14:32, 8 April 2014 (UTC)
This looks like something Module:Math could be updated to handle. Jackmcbarn (talk) 23:09, 8 April 2014 (UTC)
Wikid, one thing I would add to this is a tracking category - this would enable users who know the template syntax to patrol pages containing errors. — Mr. Stradivarius ♪ talk ♪ 13:36, 8 April 2014 (UTC)
Agreed that a tracking category could be used to help spot the rare typos, as with the wp:CS1 cite templates where users leave invalid cite parameters in 20-50 more pages everyday, despite the cite's glaring red-error messages which should cause people to immediately fix cite errors, but instead had been left in 9 thousand pages (1-in-240 pages) all year (2013, viewed up to 5 million pageviews), until fixed by cite gnomes. -Wikid77 14:32, 8 April 2014 (UTC)

As with citations autofixing seems a bad idea: make the errors obvious and glaring, so they get fixed as soon as possible. Just point out there's an error - it seems pointless writing code to handle all possible errors as no matter how clever and complex the code editors will always come up with more ways to break things. Error messages could be more friendly but mostly there should be errors encouraging editors to check their code.

Besides this is very different from citation templates. Errors in those appeared primarily due to the Lua transition flagging so much more of them. There's been no comparable transition in this template. Citation errors are often rather subtle - deprecated parameters, mispellings - so the template still works. A map either works or it doesn't. And maps are part of the content, not necessary but largely ignored footnotes shunted to the bottom of the page. I would think editors very rarely add a broken map to an article - they'll want to see if it works and when it doesn't work fix it immediately.

Real-life examples of script errors[edit]

So we have now established that under some circumstances, the module may produce a script error whereas previously the template would have produced an inline error. However, it is not yet clear exactly how serious the problem is. One part of my original question was about real-life examples of script errors. I was concerned about this due to Wikid mentioning here that "The migration of {Location_map} to Lua has caused problems of Script error". Wikid, could you clarify where you saw these script errors? Were there any script errors present in any articles after the migration? — Mr. Stradivarius ♪ talk ♪ 06:21, 8 April 2014 (UTC)

I hit a "Script error" when replying to a separate TfD issue. -Wikid77 (talk) 07:03, 8 April 2014 (UTC)
Was the error at TfD the same issue? The error where longitude is a nil value? — Mr. Stradivarius ♪ talk ♪ 07:12, 8 April 2014 (UTC)
Both latitude & longitude, with expressions, such as "lat=(23+5/60)" which worked in the markup-based {Location_map}. -Wikid77 (talk) 09:04, 8 April 2014 (UTC)
Expressions as input could be worked around using Module:Math#cleanNumber. I'm not sure how common that case would be, though. The cleanNumber function does rely on calling the #expr parser function via a frame object, though, which is not ideal. Better would be to update Scribunto so that we can access the #expr PHP code directly, or perhaps to write a pure Lua version. I did have a look to see if anyone has already written an open-source program that we can use, but I couldn't find anything. It looks like no-one has gone to the effort of writing such a function, as with standard Lua this issue can be worked around easily using the loadstring function; however, loadstring is disabled in Scribunto for security reasons. — Mr. Stradivarius ♪ talk ♪ 10:36, 8 April 2014 (UTC)
Has "lat=(23+5/60)" ever been used in the wild? We support decimal syntax and dms syntax. Is support for this method really necessary? @Mr. Stradivarius: I'll work on exposing #expr functionality directly to Lua. Jackmcbarn (talk) 12:39, 8 April 2014 (UTC)
I don't think it is really necessary - I can't see users expecting to be able to input expressions, and an informative error message should be enough to guide them into correcting what went wrong. From Wikid's answer above it looks like only one article is confirmed to have had a script error appear, and even if there are more that we aren't aware about the number is probably not more than five or ten. This makes me think that overall, the script error problem is not that important.

However, I tend to agree with Wikid about user-facing script error messages not being ideal - even if the actual error message tells the user exactly what they need to fix, many editors aren't aware that they can click on the script error text to find that information out. What do you think of Wikid's error checks, by the way? At first I thought that was just a mock-up that he posted here, but I see that he's actually implemented the code in Module:Location map/sandbox2. Sorry, I see that you've commented on this above, and it's a bit off-topic in this section.

Also, thanks for agreeing to expose #expr from Lua - that will be really helpful. Don't overexert yourself though! Beware of coder burnout. :) — Mr. Stradivarius ♪ talk ♪ 13:27, 8 April 2014 (UTC)

Regarding user-facing errors, Lua modules themselves have an "Allow saving code with errors" box, unchecked by default. Would something like that be useful outside of module space (not concerned about implementation, just about whether it would be a net benefit or not)? Jackmcbarn (talk) 23:33, 8 April 2014 (UTC)

──────────────────────────────────────────────────────────────────────────────────────────────────── An interesting idea. I like it for modules - a non-compiling module is no use to anyone – but I suspect it might cause many more problems with articles and so be strongly resisted. Article errors are far more diverse - Lua errors, parser errors, wikimarkup and HTML errors. And editors can easily introduce them as they work on an article. References in particular are often assembled at different times to the article, because the editor does not have access to all the sources, or does not have complete information. Sometimes errors arise when section editing, when you can't see the rest of the article. Again this is often a problem with references - removing a named one, unaware it's used in another section, for example.

It would significantly slow down editing too. If it checks for errors before saving then it has to parse and render the page, before doing it again after the page is saved, so rendering the whole page twice; for a large page that could take a minute or more. This would happen whether or not there are errors.

So the way it works now I think is fine. Show the error if possible, in red so it stands out. But leave it to editors to recognise them and fix them. With Lua's better error reporting it should be easier to spot errors as they're generated and so quickly fix them, and it's also now much easier to find and fix errors left in articles.--JohnBlackburnewordsdeeds 02:47, 9 April 2014 (UTC)

  • Autofixing is better than save-with-errors: Even a language such as Lua should be autofixing simple errors, such as inserting "then" when omitted. With the development of computer-language design using LALR(1) grammars, the hope of the past 40 years has been to autofix the simple syntax errors and continue operation, when following the grammar production rules to find the token "then" is the only option to allow valid processing. In the case of an if-statement, it is common to detect an omitted "then" or "end" keyword which, if auto-corrected, would allow the script to continue running, and in fact generate the same results as if it cratered with "Script error" (missing "then"), was hand-fixed, and rerun. The problem arises when a user relies on auto-fixing of all syntax errors, such as always omit "then" in if-statements because they would be autofixed in every case; however, I think reality would be users who insert "then" in most cases, perhaps leaving only a few in the optional warning messages. Otherwise, this error-prone technology of fatal error messages, "You didn't say, 'Simon says'." (which craters on every small error) is an unfortunate problem well-solved over 40 years ago. -Wikid77 (talk) 08:23, 9 April 2014 (UTC)
When it's so easy to not mess up in the first place, I don't see the point of autofixing at all. It will lead to users not learning and will almost certainly introduce tons of subtle bugs. Jackmcbarn (talk) 12:03, 9 April 2014 (UTC)
autofixing of code is a very bad idea, for the reasons above and if you're autofixing, so you're inserting 'then' statements the editor omits, then it's not valid Lua. Editors should be writing valid Lua. Lua's not hard to learn, a programmer with experience in a similar language can get up to speed with it in an afternoon. It certainly doesn't present the same barrier to contributing that the arcane syntax of parser functions does.--JohnBlackburnewordsdeeds 12:18, 9 April 2014 (UTC)

Support for any browser[edit]

Another issue, for {Location_map}, is positioning the marker correctly for any browser, such as IE7 which has required the attribute "line-height:0" when setting the div-section position of the marker. The alternative Template:Location_map_quick uses that setting, as discussed in 2011, to set "line-height:0" and will position the marker very accurately on the MSIE browsers, as well as Firefox. -Wikid77 17:10, 7 April 2014 (UTC)

This discussion is a worthy one to have, but let's wait until we have resolved the script error issue first. In my experience, discussing multiple things at once makes it harder to come to an agreement. — Mr. Stradivarius ♪ talk ♪ 18:39, 7 April 2014 (UTC)
{{Location map}} does set line-height: 0;, on the end of line 153. Isn't that the same thing {{Location map quick}} does? I have no problem with adding any of this type of thing to the module. Jackmcbarn (talk) 18:53, 7 April 2014 (UTC)
I will check other aspects of the div-tags, to see if incompatible map positions are triggered in other browsers. -Wikid77 05:21, 8 April 2014 (UTC)