Knowledge

Module talk:Check for unknown parameters

Source 📝

21: 280: 262: 231: 552: 200: 76: 687:, that is where the fix should be applied. Adding miscellaneous one-off patches to this module is not a good idea. When you switch to the default category, you know that the preferred category does not exist so why link to it? Link to the preferred category only when it exists. 719: 646: 882:
Yes that works. Unfortunately it means that I need to call the module twice: the second time after deciding which category to use. But this will only happen if there are any unknown parameters so will not affect performance unduly. — Martin
91: 722:
which is not so good. I would prefer to only check if the category exists if there are some unknown parameters. That check can only happen in this module. Or perhaps you have a better idea — Martin
485:
means 0 or more digits. So, as long as the first digit is not zero, any number of digits (within reason) will be accepted. If you want to actually limit the range to 1–99 you might use
900:
Add comments to your code. When you are crushed by a steamroller while jaywalking Main Street, whoever comes after you to maintain that module can then know why you did what you did.
191: 128: 904: 852: 691: 616: 520: 414: 386: 459:
for a fun example. It supports values of 1–99 for some parameters (actually 1 and higher, but I'm hoping nobody will put in more than 99 unnamed parameters). –
650: 41:. 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 598: 187: 665:
does not exist. In this way we can check existence of that category only when unknown parameters are discovered, not in every single case. — Martin
624: 528: 430: 408: 394: 912: 895: 877: 860: 734: 699: 542: 163: 708:. We have to check existence before calling this module. Checking existence adds a link to the page. Therefore every transclusion of 468: 743:
appears to return a concatenated string of unknown parameters (apparently without delimiters). If there are no unknowns then the
57: 653:
instead. The problem is that this is causing thousands of links to non-existent categories to be recorded, which can be seen in
444: 740: 739:
I haven't taken any real time to study the code (it has taken me more time to write this than I spent looking at the code) but
677: 580: 169: 296: 199: 113: 26: 365: 609: 712: 52: 292: 287: 267: 636: 109: 336:
Is it possible to add a function to use Lua patterns and also limit the number? For example, if the parameter
158: 38: 705: 504:
is the frontier pattern where the next character is a digit but the previous character is not a digit – in
242: 908: 856: 695: 620: 524: 390: 149: 32: 182: 684: 642: 591:. That expression is always going to evaluate to true and so will never reach the third expression. 630: 595: 558: 46: 214: 248: 60: 453: 295:. If you would like to participate, please visit the project page, where you can join the 54: 8: 654: 464: 139: 42: 592: 154: 135: 82: 683:
What is it that I'm missing? If the problem is caused by something that happens in
657:. My suggestion is as follows. The module can accept an additional argument called 440: 435:
Nevermind, got it to work without the quotes of course. I'll update the /doc here.
426: 404: 361: 399:
Didn't even cross my mind to do that for some reason. I'll try that out, thanks!
331: 55: 890: 872: 729: 672: 460: 210: 436: 422: 418: 400: 357: 215: 886: 868: 725: 668: 815:
If this is true then you should be checking the returned value from
720:
Category:Pages using WikiProject Lepidoptera with unknown parameters
500:
requires the first digit of the enumeration to be in the range 1–9;
704:
I'll try and explain better. Or you can look at the code at around
212: 62: 279: 261: 647:
Category:Pages using WikiProject PROJECT with unknown parameters
291:, a group dedicated to improving the maintenance of Knowledge's 661:
which is a category which will be used if the one specified in
216: 493:
anchors the pattern to the end of the parameter name string;
75: 49:}} to notify an administrator to make the requested edit. 546: 59: 53: 651:
Category:WikiProject templates with unknown parameters
104: 608:which will catch other globals. Keep an eye on 612:to see if the addition reveals other globals. 865:Great, thanks. I'll look into that — Martin 758:returns an empty string. So, it looks like 741:Module:Check for unknown parameters line 113 421:by using the /sandbox version in preview. 241:does not require a rating on Knowledge's 848:before you fiddle about with categories. 583:, please replace the undefined variable 581:Module:Check_for_unknown_parameters#L-94 543:Protected edit request on 29 August 2024 810:some sort of list of unknown parameters 508:the pattern finds the boundary between 824:'Module:Check for unknown parameters' 481:) is not limited to the range 1–99. 39:heavily used or highly visible module 807:when there are no unknown parameters 449:You could also look at the check at 224: 70: 15: 285:This module is within the scope of 247:It is of interest to the following 230: 228: 112:for discussing improvements to the 27:Module:Check for unknown parameters 13: 371:Why not write a specific pattern? 86: 14: 932: 610:Category:Pages with script errors 356:to limit the allowed parameters? 550: 516:(first digit of the enumerator). 278: 260: 229: 198: 129:Click here to start a new topic. 81:This module was considered for 74: 19: 706:Module:WikiProject banner#L-831 649:exists and if not, then we use 305:Knowledge:WikiProject Templates 637:Module_talk:WikiProject banner 308:Template:WikiProject Templates 1: 913:11:48, 5 September 2024 (UTC) 896:09:06, 5 September 2024 (UTC) 878:08:55, 5 September 2024 (UTC) 861:22:22, 4 September 2024 (UTC) 735:21:02, 4 September 2024 (UTC) 700:15:35, 4 September 2024 (UTC) 678:14:19, 4 September 2024 (UTC) 299:and see a list of open tasks. 126:Put new text under old text. 641:We are using this module on 477:(should probably be written 114:Check for unknown parameters 7: 625:18:08, 29 August 2024 (UTC) 599:17:57, 29 August 2024 (UTC) 573:to reactivate your request. 561:has been answered. Set the 417:doesn't work. Tested it on 134:New to Knowledge? Welcome! 10: 937: 634: 816: 759: 744: 685:Module:WikiProject banner 643:Module:WikiProject banner 605: 529:22:00, 24 June 2024 (UTC) 469:19:43, 24 June 2024 (UTC) 445:13:09, 23 June 2024 (UTC) 431:13:06, 23 June 2024 (UTC) 409:13:01, 23 June 2024 (UTC) 395:12:59, 23 June 2024 (UTC) 372: 366:12:26, 23 June 2024 (UTC) 273: 255: 164:Be welcoming to newcomers 718:is generating a link to 713:WikiProject Lepidoptera 489:where (right to left) 159:avoid personal attacks 631:Suggested enhancement 512:(parameter name) and 497:means 0 or 1 digits; 288:WikiProject Templates 192:Auto-archiving period 645:. We first check if 89:. The result of the 45:, editors may use {{ 655:Special:WantedPages 352:and something like 606:require ('strict') 311:Templates articles 243:content assessment 170:dispute resolution 131: 905:Trappist the monk 894: 876: 853:Trappist the monk 733: 692:Trappist the monk 676: 617:Trappist the monk 604:Done. Also added 577: 576: 521:Trappist the monk 415:Trappist the monk 387:Trappist the monk 350:regexp1 = "date+" 327: 326: 323: 322: 319: 318: 223: 222: 150:Assume good faith 127: 103: 102: 69: 68: 928: 884: 866: 847: 846: 843: 840: 837: 834: 831: 828: 825: 822: 819: 806: 798: 794: 790: 784: 783: 780: 777: 774: 771: 768: 765: 762: 757: 756: 753: 750: 747: 723: 717: 711: 666: 664: 660: 607: 590: 586: 568: 564: 554: 553: 547: 515: 511: 507: 503: 499: 496: 492: 488: 484: 480: 476: 458: 452: 382: 381: 378: 375: 355: 351: 347: 343: 339: 313: 312: 309: 306: 303: 282: 275: 274: 264: 257: 256: 234: 233: 232: 225: 217: 203: 202: 193: 105: 88: 87:2019 December 30 78: 71: 63: 37:because it is a 23: 22: 16: 936: 935: 931: 930: 929: 927: 926: 925: 844: 841: 838: 835: 832: 829: 826: 823: 820: 817: 802: 796: 792: 791:when either of 788: 781: 778: 775: 772: 769: 766: 763: 760: 754: 751: 748: 745: 715: 709: 662: 658: 639: 633: 588: 584: 566: 562: 551: 545: 513: 509: 505: 501: 498: 494: 490: 486: 482: 478: 474: 456: 450: 379: 376: 373: 353: 349: 345: 341: 340:can be between 337: 334: 310: 307: 304: 301: 300: 219: 218: 213: 190: 176: 175: 145: 65: 64: 58: 20: 12: 11: 5: 934: 924: 923: 922: 921: 920: 919: 918: 917: 916: 915: 901: 880: 849: 813: 812: 811: 808: 800: 799:is not a table 688: 632: 629: 628: 627: 613: 575: 574: 555: 544: 541: 540: 539: 538: 537: 536: 535: 534: 533: 532: 531: 517: 411: 383: 333: 330: 325: 324: 321: 320: 317: 316: 314: 283: 271: 270: 265: 253: 252: 246: 235: 221: 220: 211: 209: 208: 205: 204: 178: 177: 174: 173: 166: 161: 152: 146: 144: 143: 132: 123: 122: 119: 118: 117: 101: 100: 79: 67: 66: 61: 56: 51: 50: 47:edit protected 24: 9: 6: 4: 3: 2: 933: 914: 910: 906: 902: 899: 898: 897: 892: 888: 881: 879: 874: 870: 864: 863: 862: 858: 854: 850: 814: 809: 805: 801: 787: 786: 742: 738: 737: 736: 731: 727: 721: 714: 707: 703: 702: 701: 697: 693: 689: 686: 682: 681: 680: 679: 674: 670: 656: 652: 648: 644: 638: 626: 622: 618: 614: 611: 603: 602: 601: 600: 597: 594: 582: 572: 569:parameter to 560: 556: 549: 548: 530: 526: 522: 518: 472: 471: 470: 466: 462: 455: 448: 447: 446: 442: 438: 434: 433: 432: 428: 424: 420: 416: 412: 410: 406: 402: 398: 397: 396: 392: 388: 384: 370: 369: 368: 367: 363: 359: 329: 315: 298: 294: 290: 289: 284: 281: 277: 276: 272: 269: 266: 263: 259: 258: 254: 250: 244: 240: 236: 227: 226: 207: 206: 201: 197: 189: 186: 184: 180: 179: 171: 167: 165: 162: 160: 156: 153: 151: 148: 147: 141: 137: 136:Learn to edit 133: 130: 125: 124: 121: 120: 115: 111: 107: 106: 98: 94: 93: 84: 80: 77: 73: 72: 48: 44: 40: 36: 34: 28: 25: 18: 17: 804:empty string 803: 746:table.concat 640: 589:preview_text 578: 570: 559:edit request 473:The pattern 335: 332:Lua patterns 328: 286: 249:WikiProjects 238: 195: 181: 108:This is the 97:no consensus 96: 90: 35:from editing 31:permanently 30: 842:parent_args 454:Interlinear 419:TNA Impact! 354:reglimit1=8 836:parameters 635:See also: 563:|answered= 348:and using 297:discussion 92:discussion 785:returns: 461:Jonesey95 302:Templates 293:templates 268:Templates 172:if needed 155:Be polite 110:talk page 43:consensus 33:protected 659:fallback 183:Archives 140:get help 818:require 663:unknown 593:Awesome 585:preview 487:%f%d?$ 374:regexp1 346:|date8= 342:|date1= 196:90 days 116:module. 83:merging 830:_check 767:_check 506:abc123 437:Gonnym 423:Gonnym 401:Gonnym 380:"date" 358:Gonnym 338:|date= 245:scale. 239:module 797:pargs 779:pargs 596:Aasim 587:with 567:|ans= 557:This 237:This 168:Seek 95:was " 909:talk 891:talk 887:MSGJ 873:talk 869:MSGJ 857:talk 795:and 793:args 773:args 730:talk 726:MSGJ 696:talk 673:talk 669:MSGJ 621:talk 525:talk 465:talk 441:talk 427:talk 405:talk 391:talk 362:talk 344:and 157:and 789:nil 752:res 579:On 565:or 495:%d? 483:%d* 479:%d* 85:on 29:is 911:) 889:· 871:· 859:) 827:). 728:· 716:}} 710:{{ 698:) 671:· 623:) 571:no 527:) 502:%f 491:$ 467:) 457:}} 451:{{ 443:) 429:) 407:) 393:) 364:) 194:: 138:; 99:". 907:( 903:— 893:) 885:( 875:) 867:( 855:( 851:— 845:) 839:, 833:( 821:( 782:) 776:, 770:( 764:. 761:p 755:) 749:( 732:) 724:( 694:( 690:— 675:) 667:( 619:( 615:— 523:( 519:— 514:1 510:c 475:* 463:( 439:( 425:( 413:@ 403:( 389:( 385:— 377:= 360:( 251:: 188:1 185:: 142:.

Index

Module:Check for unknown parameters
protected
heavily used or highly visible module
consensus
edit protected

merging
discussion
talk page
Check for unknown parameters
Click here to start a new topic.
Learn to edit
get help
Assume good faith
Be polite
avoid personal attacks
Be welcoming to newcomers
dispute resolution
Archives
1

content assessment
WikiProjects
WikiProject icon
Templates
WikiProject icon
WikiProject Templates
templates
discussion
Gonnym

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.