Module talk:Person date
| This is the talk page for discussing improvements to the Person date module. |
|
Add unknown catch?
[edit]So in the rollout of this I’ve noticed a few infoboxes ({{Infobox writer}}, {{Infobox comics creator}} and others) have the following:
{{br separated entries
| 1={{{birth_name|}}}
| 2={{#switch:{{lc:{{{birth_date|}}}}}
|? |?? |??? |???? |19? |19?? |18?? |17?? |u |unk |unknown = {{abbr|DOB|Date of birth}} unknown
| {{{birth_date|}}}
}}
| 3={{{birth_place|}}}
}}
I’m curious if that should be folded into this code? @Gonnym and Jonesey95: any thoughts? — Zackmann (Talk to me/What I been doing) 21:49, 26 September 2025 (UTC)
- I would prefer to see that sort of input marked as invalid so that it can be removed. A partially known birth year can be explained in the body and should not be in the infobox. – Jonesey95 (talk) 22:22, 26 September 2025 (UTC)
- That seems like a reasonable approach to me! I’ll wait for others to chime in but otherwise I’ll implement some category tracking. —Zackmann (Talk to me/What I been doing) 22:27, 26 September 2025 (UTC)
- Ok so I’ve mocked up a tracking category that I’m calling Category:Pages where birth or death date is unacceptable. It checks for the above cases. see the diff. Gonnym if you are happy with the sandbox code, let me know and I’ll push it through (or you can).
- I’ve setup the testcases to properly look at and compare Module:Person date with Module:Person date/sandbox. Zackmann (Talk to me/What I been doing) 08:31, 27 September 2025 (UTC)
- I didn't test my changes, so those need to be test. Regarding the category name, I think Category:Pages with invalid birth or death dates would be clearer. I also agree with Jonesey, partial dates like that should not be supported. Gonnym (talk) 12:34, 28 September 2025 (UTC)
- MoS guideline at MOS:CIRCA. Gonnym (talk) 12:35, 28 September 2025 (UTC)
Implemented - Zackmann (Talk to me/What I been doing) 22:31, 29 September 2025 (UTC)
- MoS guideline at MOS:CIRCA. Gonnym (talk) 12:35, 28 September 2025 (UTC)
- I didn't test my changes, so those need to be test. Regarding the category name, I think Category:Pages with invalid birth or death dates would be clearer. I also agree with Jonesey, partial dates like that should not be supported. Gonnym (talk) 12:34, 28 September 2025 (UTC)
- That seems like a reasonable approach to me! I’ll wait for others to chime in but otherwise I’ll implement some category tracking. —Zackmann (Talk to me/What I been doing) 22:27, 26 September 2025 (UTC)
So in a recent discussion, @Nikkimaria, Nehme1499, and Number 57: brought to my attention that per MOS:INFOBOX, If a parameter is not applicable, or no information is available, it should be left blank, and the template coded to selectively hide information or provide default values for parameters that are not defined.
There is also the essay WP:UNKNOWN. With that in mind, since we already have a hook to check for values that contain question marks (i.e. |death_date=?, |birth_date=19??, etc) and place them in Category:Pages with invalid birth or death dates should we expand on that and simply suppress these values as well as those that simply supply |..._date=Unknown? Right now the code does NOT change the display for these values, it just adds the page to the tracking category. I can very easily set it up so that if one of those values is passed it will not be displayed at all. (Note this would NOT prevent things like "1910s", "c. 1905", "around 1925", "1918 or 19", etc. The regex I'm talking about would only affect dates that contain a question mark or contain the word unknown (without a reference, dates that are "Unknown" with a ref tag inline would not be affected.
At the moment this code is live on over 1.1 million pages, so I want to make sure that any changes made are clearly vetted and discussed. At first glance, this proposal seems very much in line with MOS, but are there situations I'm not considering or OTHER MOS policies I don't know about that this type of change would be in violation of? Thanks in advance for the input! --Zackmann (Talk to me/What I been doing) 06:10, 15 October 2025 (UTC)
- The parameter should be hidden when nothing is known (the "?" or "unknown" case). The "19??" case, though, is a bit different - sometimes it's an assumption about something that's really unknown, but sometimes it's substituting for a "circa" or a "1910s"-type value. Nikkimaria (talk) 23:16, 15 October 2025 (UTC)
- One additional thought I had is that if we implement this, there should definitely be a {{preview warning}}. It would be rather confusing for an editor to put
|birth_date=unknownand just have nothing show up. I know it would drive me nuts if that happened and it would require a pretty deep dive to see why that is being suppressed. At least this way we can put a preview message saying something along the lines of This value is invalid per MOS:INFOBOX & WP:UNKNOWN, it will not be shown when saved. (Obviously open to suggestions on better language). - Nikkimaria per your point about the
19??case, I would still have things placed in the maintenence category (Category:Pages with invalid birth or death dates) so we can certainly go through and clean up things like19??with{{circa|1900}}or something. Zackmann (Talk to me/What I been doing) 23:25, 15 October 2025 (UTC)- So Category:Pages with invalid birth or death dates (4,540) has exploded since I added
Unknownto populate the category as well. Full disclosure, many of those are a result of me adding Unknown early on in the implementation of this module. This was BEFORE I was educated on MOS:INFOBOX and WP:UNKNOWN. Not doing it anymore and plan to fix those that I did insert "Unknown" into. Zackmann (Talk to me/What I been doing) 20:45, 16 October 2025 (UTC)- Mocked something up in the infobox... The message displayed Preview warning: birth_date "VALUE" is invalid per MOS:INFOBOX & WP:UNKNOWN, it will not be shown when saved. VALUE is replaced by whatever invalid input was supplied. I.E.
Unknown,??etc. Also when the error is on death_date instead the warning changes to reflect that. Zackmann (Talk to me/What I been doing) 22:24, 16 October 2025 (UTC)- I went ahead and filed an RFC here to get guidance on how to proceed. Zackmann (Talk to me/What I been doing) 23:45, 21 October 2025 (UTC)
- Mocked something up in the infobox... The message displayed Preview warning: birth_date "VALUE" is invalid per MOS:INFOBOX & WP:UNKNOWN, it will not be shown when saved. VALUE is replaced by whatever invalid input was supplied. I.E.
- So Category:Pages with invalid birth or death dates (4,540) has exploded since I added
- One additional thought I had is that if we implement this, there should definitely be a {{preview warning}}. It would be rather confusing for an editor to put
Proper testcases
[edit]I have implemented proper testcases. Please add any edge cases you can think of that we want to be sure and test moving forward. —Zackmann (Talk to me/What I been doing) 05:21, 1 October 2025 (UTC)
Code review request
[edit]@Gonnym, Jonesey95, Jevansen, and WOSlinker: At your earliest convenience can you review the code in the sandbox? Given how widely used this code is now, I'm wary of committing anything that has the potential to break hundreds of thousands of pages without a second set of eyes. It is a bit of a refactor and a bit of new behavior:
- It will take into account the presence of a
|disappeared_date=. If one is present (i.e. the value is not null) it will NOT modify the value of birth_date in anyway and thus not calculate the age for someone who has dissapeared. - It sets up a future improvement whereby age at disappearance can also be automatically calculated (not doing that now, but laying the ground work).
- I changed the way that I am collecting the args so that I can implement the module directly in the Infobox (bypassing {{Infobox person/birth}} & {{Infobox person/death}}). Critically those still work, but it will also check for the values of
|birth_date=and|death_date=
Note that there are expected failures in the testcases because of the change and newly implemented testcases. Thanks in advance! - Zackmann (Talk to me/What I been doing) 08:04, 19 October 2025 (UTC)
- @Zackmann08: Looks mainly ok. I think you should check for named parameters before numbered ones though and probably work towards not using numbered params at all once everywhere is using named params. Examples below. -- WOSlinker (talk) 08:15, 19 October 2025 (UTC)
Infobox person | |
|---|---|
| Born | 1 January 1950 |
Infobox person/sandbox | |
|---|---|
| Born | 1 January 1950 |
- @WOSlinker: VERY good catch. The plan is to eliminate the numbered params, but in the mean time should def default to the named ones first. Good thinking. --Zackmann (Talk to me/What I been doing) 08:32, 19 October 2025 (UTC)