Jump to content

Template talk:PD-old-text

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Empty title bug

[edit]

@SMcCandlish, Primefac, VernoWhitney, Toon05, and Moonriddengirl: I'm not much of a template editor, so I'm passing along this bug observation for someone to fix.

User:CWH/sandbox includes the markup {{PD-old-text|title=|year=}}, which expands to

[[Image:PD-icon.svg|15px|link=|alt=]] ''This article incorporates text from '''', a publication from now in the [[public domain]] in the United States.''

The four apostrophes get evaluated as '<b>, which displays as a spurious apostrophe and spurious bold after that. What's needed where the title parameter is empty is ''<nowiki/>'', so that this sample sandbox markup would expand to

[[Image:PD-icon.svg|15px|link=|alt=]] ''This article incorporates text from ''<nowiki/>'', a publication from now in the [[public domain]] in the United States.''

This should not be difficult. There may be other templates with similar issues; I just happened to bump into this one. —Anomalocaris (talk) 06:39, 3 December 2020 (UTC)[reply]

I think it would make much more sense to instead have it emit a big red title missing error, since there is no use case for this template without a title in it (same goes for year). These parameters shouldn't ever be empty in mainspace, since this is a legal template and needs to be correct.  — SMcCandlish ¢ 😼  06:44, 3 December 2020 (UTC)[reply]
@Anomalocaris: I've implemented that in the /sandbox, and have testcased it. Barring any objections, I'll implement that as the live code, if someone pings me with a reminder after a while (or anyone else can do it). PS: I also implemented a |date= alias for |year=, and a |work= alias for |title=. If someone else does it, update the template /doc about the parameters and behavior, or ping me and I'll do it.  — SMcCandlish ¢ 😼  07:05, 3 December 2020 (UTC)[reply]
My apologies, I saw "I sandboxed" and then saw you had edited the template (granted, it was back in March), and didn't think to check the sandbox to see if the changes to the template were the same as those made to the main template. I've either got too much caffeine in the system this morning, or not enough. Primefac (talk) 14:14, 3 December 2020 (UTC)[reply]
@Primefac: Not sure I follow. The OP reports noticing an error while using the template in that editor's sandbox. I was talking about tweaking and testing the code in this template's /sandbox. I didn't update the actual "live" template code yet, in case someone had some kind of issue to raise that I hadn't thought of. PS: I'm only just now starting the day's vital coffee flow, so I may be denser than usual at this moment.  — SMcCandlish ¢ 😼  18:48, 3 December 2020 (UTC)[reply]
You said you had I've implemented that in the /sandbox and tested it, which to my sleep-addled brain meant you had also implemented it when I saw your most-recent-edit to the main template. I think all concerns have been met, though, at least as far as Anomalocaris is concerned. Personally, I don't think we need a bunch of name variants for the various parameters. Primefac (talk) 20:08, 3 December 2020 (UTC)[reply]
It's mostly for the benefit of people who use citation templates in certain habitual ways. E.g., |year= is largely deprecated, and better inter-template compatibility is had when using |work= instead of one of its more specific aliases like |website=, |newspaper=, |journal=, etc. So, many of us are strongly habituated to |date= and |work= when dealing with citation templates.  — SMcCandlish ¢ 😼  17:26, 30 December 2020 (UTC)[reply]