Template talk:If empty
Template:If empty is permanently protected from editing because it is a heavily used or highly visible template. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use {{edit protected}} to notify an administrator to make the requested edit. Usually, any contributor may edit the template's documentation to add usage notes or categories.
Any contributor may edit the template's sandbox. Functionality of the template can be checked using test cases. |
Edit request
editThis edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Please merge {{If empty/sandbox}} into here. I believe User:Jackmcbarn and I have tested it quite thoroughly to ensure backwards compatibility. The only difference now is that this template is no longer limited to nine parameters and that it should run considerably faster. Also, someone may want to protect Module:If empty. —CodeHydro 21:52, 23 December 2014 (UTC)
Error transclusion issue with the new Lua version
editSince Module:If empty went live, all uses of {{Infobox mountain}} are transcluding errors. There is just one {{error}} check in this template, to ensure that the parameter name is given. I verified with {{Infobox mountain/sandbox}} that the old template did not transclude false errors unless the name truly was not given. Wbm1058 (talk) 18:33, 26 December 2014 (UTC)
- @Codehydro and Jackmcbarn: any comments? Can either of you fix this? I'm not following what you mean by "fragile, convoluted, hacky way to do it". Thanks, Wbm1058 (talk) 22:47, 26 December 2014 (UTC)
- Please describe how you found this error and what exactly is wrong. I do not see any problems on any of the pages that use {{Infobox mountain}} —CodeHydro 23:48, 26 December 2014 (UTC)
- Look at the pages transcluding {{error}}s in main namespace. Most are mountain articles such as Mount Kilimanjaro, which transclude {{Infobox mountain}}. There are no actual errors in these articles, and that's why I call these "false transclusions". {{error}} should only be transcluded in these articles when the name is missing and the error message "Mountain name required" is shown at the top of the infobox. This is how I patrol for these, by looking for {{error}} transclusions. Wbm1058 (talk) 00:04, 27 December 2014 (UTC)
- See Template:If empty/testcases. Wbm1058 (talk) 02:35, 27 December 2014 (UTC)
- Thanks for pointing this out. I've rewritten the error check at {{Infobox mountain}}'s sandbox as not to use this module at all. While using {{If empty}} to produce a transclusion is clever, it's not at all a common use (based on the relatively tiny number of transclusions of {{error}} in template space). The purpose of this module is to check multiple variables... even though this module is much less expensive than the old wikitext template, it is more expensive than a simple #if call, which is what should be used to check a single empty param. While I have an idea how to make the module avoid false transfusions, I do not want to encourage this usage. —CodeHydro 04:50, 27 December 2014 (UTC)
- Thanks, Codehydro. Now I see that similar changes are needed for {{Infobox mountain pass}}, {{Infobox cave}} and {{Infobox landform}}. I'm willing to make these fixes myself, but thought I'd offer them to you as an opportunity to build up your template-edit-request track record, if you would like to do that. Thanks again, Wbm1058 (talk) 14:37, 27 December 2014 (UTC)
- Thanks. I've applied the change to each of those templates. None are protected so doesn't really help me get template editor at all since I've no shortage of non-protected edits, but the thoughtfulness is appreciated. —CodeHydro 15:17, 27 December 2014 (UTC)
- Great. One more: {{Infobox climbing area}}. Wbm1058 (talk) 15:50, 27 December 2014 (UTC)
- @Wbm1058 and Codehydro: This is actually a bug in Module:Arguments. Once I get it fixed, this won't be a problem anymore. You don't need to "fix" any more templates that use this, as they'll all be fixed again soon. Jackmcbarn (talk) 05:00, 28 December 2014 (UTC)
- Great. One more: {{Infobox climbing area}}. Wbm1058 (talk) 15:50, 27 December 2014 (UTC)
- Thanks for pointing this out. I've rewritten the error check at {{Infobox mountain}}'s sandbox as not to use this module at all. While using {{If empty}} to produce a transclusion is clever, it's not at all a common use (based on the relatively tiny number of transclusions of {{error}} in template space). The purpose of this module is to check multiple variables... even though this module is much less expensive than the old wikitext template, it is more expensive than a simple #if call, which is what should be used to check a single empty param. While I have an idea how to make the module avoid false transfusions, I do not want to encourage this usage. —CodeHydro 04:50, 27 December 2014 (UTC)
- Please describe how you found this error and what exactly is wrong. I do not see any problems on any of the pages that use {{Infobox mountain}} —CodeHydro 23:48, 26 December 2014 (UTC)
Backcompat
editThe tracking category is empty except for this template's testcases page (and I suspect it has been for years), so the backcompat code can probably be removed from the module. 「ディノ奴千?!」☎ Dinoguy1000 02:51, 29 April 2022 (UTC)
- Agreed. * Pppery * it has begun... 15:29, 2 May 2022 (UTC)
- @Pppery: I've removed the backwards compatibility code from the module's sandbox (which also has a never-deployed bugfix); the testcases page looks fine (other than the undefined parameters case, which is to be expected). If everything looks good to you, it can be deployed and the tracking category tagged for deletion. 「ディノ奴千?!」☎ Dinoguy1000 06:49, 5 May 2022 (UTC)
- Looks good to me. * Pppery * it has begun... 13:38, 5 May 2022 (UTC)
- Updated and tracking category deleted. 「ディノ奴千?!」☎ Dinoguy1000 04:44, 6 May 2022 (UTC)
- Looks good to me. * Pppery * it has begun... 13:38, 5 May 2022 (UTC)
- @Pppery: I've removed the backwards compatibility code from the module's sandbox (which also has a never-deployed bugfix); the testcases page looks fine (other than the undefined parameters case, which is to be expected). If everything looks good to you, it can be deployed and the tracking category tagged for deletion. 「ディノ奴千?!」☎ Dinoguy1000 06:49, 5 May 2022 (UTC)
lastk?
editThis edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
As far as I can tell, in Module:If empty, the variable lastk (defined at line 6 and set at line 11) is never used. Can we remove it, or is there something tricky going on? — hike395 (talk) 10:42, 11 January 2023 (UTC)
- Removed in the sandbox version, tests look fine. — hike395 (talk) 10:45, 11 January 2023 (UTC)
- Please copy Module:If empty/sandbox to Module:If empty, see above. — hike395 (talk) 06:35, 22 January 2023 (UTC)
- Done — Martin (MSGJ · talk) 18:33, 26 January 2023 (UTC)