Jump to content

Module talk:Check DYK hook

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Frietjes (talk | contribs) at 15:52, 27 November 2020 (Script error). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Script error

@Frietjes and Mr. Stradivarius:

This [1] apparently 'fixed' some script errors, but broke the checks. At least, for entries ending with {{-?}} and made Category:Pages with a malformed DYK entry balloon to 160+ 'malformed' entries, which were perfectly well-formed. Headbomb {t · c · p · b} 15:17, 27 November 2020 (UTC)[reply]

It's possible that it did fix the script, but that the check itself didn't handle those entries. But this is LUA, so I can't diagnose anything here much. Headbomb {t · c · p · b} 15:18, 27 November 2020 (UTC)[reply]
Headbomb, yes, before the fix those 160+ entries were in Category:Pages with script errors instead. I think the regular expression requires some changes you may be able to test it with

Live

  • "{{#invoke:Check DYK hook|isValidHook|1=... that director and screenwriter Travis Stevens paused renovations on his production company's house to film '''''[[Girl on the Third Floor]]'''''?}}" = "yes"
  • "{{#invoke:Check DYK hook|isValidHook|1=... that director and screenwriter Travis Stevens paused renovations on his production company's house to film '''''[[Girl on the Third Floor]]'''''{{-?}}}" = "yes"

Sandbox

  • "{{#invoke:Check DYK hook/sandbox|isValidHook|1=... that director and screenwriter Travis Stevens paused renovations on his production company's house to film '''''[[Girl on the Third Floor]]'''''?}}" = "yes"
  • "{{#invoke:Check DYK hook/sandbox|isValidHook|1=... that director and screenwriter Travis Stevens paused renovations on his production company's house to film '''''[[Girl on the Third Floor]]'''''{{-?}}}}" = "yes"
not sure why we are getting a script error for the live template even with the |1=. Frietjes (talk) 15:26, 27 November 2020 (UTC)[reply]
Headbomb, it looks like the "match" used for whitespace cleaning was returning "nil" in those cases but changing it to a mw.ustring.gsub (see here) fixed it. or at least fixed it so both cases are showing valid and no script errors. Frietjes (talk) 15:42, 27 November 2020 (UTC)[reply]
@Frietjes: seems to work yup. Thanks. I could never have caught that. Headbomb {t · c · p · b} 15:46, 27 November 2020 (UTC)[reply]
Headbomb, unfortunately, for the "#if:" parser an error is the same as "yes" which is probably why it wasn't noticed earlier. Frietjes (talk) 15:52, 27 November 2020 (UTC)[reply]