Template:KnownIssueDupCheck
Appearance
Template:KnownIssueDupCheck
Place this once on a page that uses Template:KnownIssue (typically just above the table). It scans the page source and shows a red warning for either of:
- Duplicate IDs — an integer
IDused by more than oneKnownIssue(these would emit the same#KnownIssueNanchor twice). - Missing IDs — rows with no
IDassigned.
Each is a separate message. When everything is clean it renders nothing.
{{KnownIssueDupCheck}}
{| class="sortable wikitable"
...
{{KnownIssue | ID = 73 | ... }}
{{KnownIssue | ID = 74 | ... }}
|}
How it works
It reads the current page via mw.title.getCurrentTitle():getContent()
(see Module:KnownIssue) and counts ID parameters across every
KnownIssue call on the page, including hide=yes and
anchor=no rows.
Caveats
- Saved revision only
getContent()returns the last saved version of the page, so
while previewing an unsaved edit the check will not yet reflect your changes — save and reload to re-run it.
- Source-level
- It counts literal
KnownIssuecalls in the page source; issues
pulled in by transclusion from another page are not seen.
- Expensive
getContent()is a MediaWiki "expensive" parser call. One use per
page is well within limits.