wikimedia-gadgets / afc-helper

A tool for reviewing Articles for Creation submissions on the English Wikipedia
https://en.wikipedia.org/wiki/Wikipedia:AFCH
GNU General Public License v3.0
36 stars 80 forks source link

Provide Template:L with 'MISSING' as second parameter if date is omitted #294

Closed sohomdatta1 closed 1 year ago

sohomdatta1 commented 1 year ago

Fixes #293

NovemLinguae commented 1 year ago

Sorry for yet another -1, but I found a bug (possibly unrelated to this patch, but probably best to fix it now if you don't mind). Accepting a draft with these settings...

image

Outputs...

{{subst:L|1=|2=UNKNOWN|3=}}

Instead of...

{{subst:L|1=1901|2=UNKNOWN|3=Magellan, Ferdinand}}

So I guess when the user selects living=unknown, variables such as data.birthYear and data.subjectName are getting blanked or not set?

sohomdatta1 commented 1 year ago

Sorry for yet another -1, but I found a bug (possibly unrelated to this patch, but probably best to fix it now if you don't mind). Accepting a draft with these settings...

image

Outputs...

{{subst:L|1=|2=UNKNOWN|3=}}

Instead of...

{{subst:L|1=1901|2=UNKNOWN|3=Magellan, Ferdinand}}

So I guess when the user selects living=unknown, variables such as data.birthYear and data.subjectName are getting blanked or not set?

That is an interesting find, it's not related to this specific issue but it seems like we compare the current value with the placeholder. If they are the same, the values are wiped (you entered Magellan, Ferdinand and 1901 both of which are the placeholders for their respective fields) i.e. only drafts of living people with birth dates in 1901 (or with names Magellan, Ferdinand) will face this issue :smile:

I've gone ahead and removed the placeholder code, since in general on modern browsers placeholders are not returned as the value of the input :)

NovemLinguae commented 1 year ago

Tested 4 cases. Fixed a typo in the template at https://en.wikipedia.org/w/index.php?title=Template:Person_categories&diff=prev&oldid=1175958007. I think we're good now. Thanks for your patch and for all the back and forth.