Wikipedia talk:WikiProject U.S. counties/County5
This project page does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | |||||||||||
|
Problem with template
[edit]Something is going very weird with this article's transclusion... all the following have problems:
As far asIcan make out, it's not the template or the articles that aren't working. The redlinks that apear link to County5... you normally get these when one transcludes a page that doesn't exsist, but the spftware shoudl be transcluding Template:County5 instead. So, I'm stumped. Tompw (talk) 12:06, 12 March 2007 (UTC)
- I reverted your recent edits hoping that would correct the problem, but it didn't. You can revert my revision if you like, but I hope someone can straighten this out soon. List of counties in Kentucky is a featured list I'd hate for it to get de-listed over this. Acdixon 14:27, 12 March 2007 (UTC)
- I don't know why this just started happening, but there are too many instances of these templates in the pages. If you look at the generated HTML code of the Kentucky county page, you'll see the following comment:
<!-- Pre-expand include size: 2047837 bytes Post-expand include size: 58697 bytes Template argument size: 16532 bytes Maximum: 2048000 bytes -->
- That top number, the pre-expand include size, cannot be over 2,048,000. So once it hits that number, all templates after that point stop working. I really don't know why this template worked earlier and just stopped working. Maybe a glitch or an issue for WP:VPT to look into. I've moved the documentation to a subpage as that is one of the recommended methods for issue such as this. The only other solution I can think of, and its a last resort, is to subst all the instances of the templates.↔NMajdan•talk 20:05, 12 March 2007 (UTC)
- In looking at the code of this template, I think what is killing this template is the fact that it calls {{FIPSStateName}} which in turn calls {{StateName}}. So for every instance of this template, its actually three templates. If we can figure out a way to combine these three templates into this one template, we should be ok.↔NMajdan•talk 20:11, 12 March 2007 (UTC)
- OK, I've transcluded everything directly so {{County5}} no longer calls any other templates. It all works now, so many thanks for suggesting that. :-) Tompw (talk) 23:02, 12 March 2007 (UTC)
- In looking at the code of this template, I think what is killing this template is the fact that it calls {{FIPSStateName}} which in turn calls {{StateName}}. So for every instance of this template, its actually three templates. If we can figure out a way to combine these three templates into this one template, we should be ok.↔NMajdan•talk 20:11, 12 March 2007 (UTC)
- That top number, the pre-expand include size, cannot be over 2,048,000. So once it hits that number, all templates after that point stop working. I really don't know why this template worked earlier and just stopped working. Maybe a glitch or an issue for WP:VPT to look into. I've moved the documentation to a subpage as that is one of the recommended methods for issue such as this. The only other solution I can think of, and its a last resort, is to subst all the instances of the templates.↔NMajdan•talk 20:05, 12 March 2007 (UTC)
Comments by Paul Robinson
[edit]As the original designer of this macro, I have a few comments. Someone sent me a message saying it doesn't work right, but it seems to be okay; maybe there was an error in the way someone changed it that has been fixed. My first rule has been, get it to work right, then get it to be pretty, or neat, or clean, or better functionality. But given the two I'd prefer ease of future maintenance over efficiency.
I have been reading some of the comments here, and it seems like limits in the way Wikimedia (the software that runs Wikipedia) works means that normal good practices in software development, such as subroutine usage (Transclusion macros) and not duplicating information become ineffective or fail to operate when used in this context. Now, moving the documentation to another page isn't a bad idea; I've done it in other places (transclusion in a noinclude zone in order to use the same instructions on multiple pages; see Template:Area Code Box 1 as well as 0, and 2 through 6 and they all include the same instructions.) and if I had thought of it, I would have. (I think most templates are badly documented, and I've found that even if I think I'm the only one who will use it, if I don't documemt what the arguments are, I'll not remember them in six months.)
As far as doing two or three macro calls, the point is that if I have a list of state codes in every macro, instead of changing one macro if there is an error, a misspelling or a change - let's say Puerto Rico or DC gets statehood - instead of changing one macro in one place, every macro that has a list has to be changed. If doing this isn't going to work or is going to cause a problem, that's a damned shame, since it defeats one of the prime tenets of database development: don't duplicate data. Now maybe this is one that is unlikely to change, but still, I think conserving data to fewer places is a Good Thing, but if it has to be changed to make the system work, so be it.
The purpose of using a macro was to reduce the size of the page (basically List of counties in Kentucky was the first one to use this macro, I think), and to clean up the internal format of the page. I was unaware that there were also net generated page size limits. (Possibly to prevent endless loops or to reduce errors.)
I notice that I'm on a DSL connection and List of counties in Oklahoma takes forever to load, mostly because of repeated county maps.
Can someone tell me where they got the numbers from? I looked at the source of the page and did not see a size summary. Wikimedia says (for List of Counties in Kentucky the edited page is 39K. Netscape's "Page Info" menu says the edit page is 41.44K (44474 bytes); and it says the display page is 26.41 KB (27045 bytes). I never use Internet Explorer so I don't know if it gives a different figure, and maybe it does. Now, unless you are (or wikimedia is) counting inclusion of images toward size limits, I am curious as to where the 2.7mb size figure came from. If you're referring to a different page, then that's a different matter, and maybe something can be done about it.
If that is the case, I am thinking of making a change to the page which might reduce its size and provide better functionality, because of a feature I (and others) petitioned to have added to the software that generates these pages and I have confirmed is operational and correct after noticing a bug. I'll see how it works. Paul Robinson (Rfc1394) 03:00, 13 March 2007 (UTC)
- It seemed the errors were caused precisely by the way this template called another template, which in turn called a third. I switched to including them directly to get around this. I agree with your original thinking about the ease of changing things, but unfortunately it can't be used in this case. I never knew there were size limits of this sort either. I assume the number PW idsplays is the size of the (wikicode) on the database; while the "page size" a browser shows includes everythign else (toolbars etc.) Tompw (talk) 11:43, 13 March 2007 (UTC)
- On the List of counties in Kentucky article, if you look at the source code, the size info is almost at the very bottom. In the previous section of this talk page, you can see what the size was; now the size is:
<!-- Pre-expand include size: 287370 bytes Post-expand include size: 72825 bytes Template argument size: 45333 bytes Maximum: 2048000 bytes -->
- Tompw did a great job of resolving the issue. I was gonna tackle it today but came back to find it already fixed. I believe the code above only generates if the pre-expand size is over a certain value, like 100,000 bytes. Normally, there wouldn't have been an issue, but this template is called over 100 times in this article alone (and thus for every one instance of this template, three templates were actually being called) and there are only a handful of instances where this occurs on an article. I'm still not 100% sure what you are proposing, Paul, but I hope I have given you some of the information you requested.↔NMajdan•talk 20:20, 13 March 2007 (UTC)