Template talk:RQ:Swift Directions to Servants

From Wiktionary, the free dictionary
Latest comment: 9 months ago by Sgconlaw in topic Pageref not working
Jump to navigation Jump to search

Pageref not working

[edit]

@Sgconlaw J3133 (talk) 18:06, 7 September 2023 (UTC)Reply

@J3133: try it now. — Sgconlaw (talk) 22:31, 7 September 2023 (UTC)Reply
@Sgconlaw: “Lua error in Module:quote at line 1625: Can't specify more than one of |page=, |pages=, and |page_plain=” J3133 (talk) 05:09, 8 September 2023 (UTC)Reply
@J3133: you’ll have to consult @Benwing2 about Lua errors as they are maintaining “Module:quote”. I don’t know how to program in Lua. — Sgconlaw (talk) 05:20, 8 September 2023 (UTC)Reply
Which entry is throwing this error? — Sgconlaw (talk) 05:22, 8 September 2023 (UTC)Reply
@Sgconlaw: I do not know whether there is an entry that uses |pageref= with this template. I used the preview with |pages= and |pageref=. J3133 (talk) 05:24, 8 September 2023 (UTC)Reply
@J3133 What did you type that caused the error? Benwing2 (talk) 06:22, 8 September 2023 (UTC)Reply
@Benwing2: {{RQ:Swift Directions to Servants|pages=122–123|pageref=123}} The error does not occur now because Sgconlaw has undone the change. J3133 (talk) 06:25, 8 September 2023 (UTC)Reply
@Sgconlaw @J3133 I think the error is in {{RQ:Swift Works}}, which has |page= before |pageref= in the definition of |pageurl= when it should be the other way around. In general, however, I don't maintain the RQ: templates; the error thrown by Module:quote should be self-explanatory and indicates something is wrong with the RQ: templates (rather than the module). Benwing2 (talk) 07:06, 8 September 2023 (UTC)Reply
@Benwing2: OK, let me have a look at {{RQ:Swift Works}} and see if I can figure out what the issue is. Thanks. — Sgconlaw (talk) 11:53, 8 September 2023 (UTC)Reply

──────────────────────────────────────────────────────────────────────────────────────────────────── @J3133: I didn't see any obvious errors at {{RQ:Swift Works}}, and I have not been able to reproduce your error. For example, {{RQ:Swift Directions to Servants|chapter=I (Directions to the Butler)|pages=122–123|pageref=122|passage=Put your finer into every bottle to feel whether it be full, which is the surest way, for feeling has no '''fellow'''.}} produces:

1731 (date written, published 1745), Jonathan Swift, “[Directions to Servants.] Chapter I (Directions to the Butler).”, in Thomas Sheridan and John Nichols, editors, The Works of the Rev. Jonathan Swift, [], new edition, volume XVI, London: [] J[oseph] Johnson, [], published 1801, →OCLC, pages 122–123:
Put your finer into every bottle to feel whether it be full, which is the surest way, for feeling has no fellow.

Is it possible that you accidentally used |page= (instead of |pages=) with |pageref=? — Sgconlaw (talk) 15:45, 8 September 2023 (UTC)Reply

@Sgconlaw: As I mentioned, the error was before you undone your last edit. Below is that revision of the template with |pageref=122 and |pages=122–123. The issue with |pageref= not working remains (your example links to “https://archive.org/details/worksofrevjonath16swif/page//mode/1up”).
1731 (date written, published 1745), Jonathan Swift, “Directions to Servants”, in Thomas Sheridan and John Nichols, editors, The Works of the Rev. Jonathan Swift, [], new edition, volume XVI, London: [] J[oseph] Johnson, [], published 1801, →OCLC, page 122 of 122–123:

J3133 (talk) 16:23, 8 September 2023 (UTC)Reply

@J3133: I can see why you triggered the error. You typed both |page=122 and |pages=122–123, which means you are specifying a value for |page= and |pages= simultaneously. That isn't allowed, and will trigger an error. (Also, I'm not clear why you would want to type |page=122 and |pages=122–123 at all—care to explain?) — Sgconlaw (talk) 16:32, 8 September 2023 (UTC)Reply
@Sgconlaw: I did not type “page={{{page|{{{pageref|122{{{2|}}}}}}}}}” and “pages={{{pages|122–123}}}}}”. I typed |pageref=122 and |pages=122–123 but it cannot be reproduced accurately here unless you revert to that revision. J3133 (talk) 16:35, 8 September 2023 (UTC)Reply
@J3133: but I did revert my edits back to the 1 August version when I determined that my later edits were not doing anything. The 1 August version of the template is the one which you said you experienced errors with. I've also reproduced it at "Template:RQ:Swift Directions to Servants/sandbox" if you want to test it. It's not triggering any errors for me:
Template:RQ:Swift Directions to Servants/sandbox
Sgconlaw (talk) 16:43, 8 September 2023 (UTC)Reply
@Sgconlaw: The error was with the 7 September revision you undid on 8 September. I have changed the sandbox to that revision; there is now an error in your example. J3133 (talk) 16:46, 8 September 2023 (UTC)Reply
@J3133: yeah, but I'm getting confused about what issue you're trying to raise. It seems like a non-issue.
  1. You post on 7 September, 18:06 (your very first post above), saying |pageref= isn't working. Thus, the "problematic" version of the template is the 1 August 2023 one.
  2. I then edit the template on 8 September, 06:30, but when I realize the edit isn't causing the problem, and in fact causes other problems, I revert it on the same date at 13:20.
  3. You are now saying that my 8 September, 06:30, edit was problematic. Yes, it was! But it's already been reverted, and I can't see any issue with the 1 August version of the template. So I guess the issue has been resolved (if it existed at all in the first place)?
Sgconlaw (talk) 17:13, 8 September 2023 (UTC)Reply
@Sgconlaw: The issue that |pageref= is not included in the |pageurl= remains; e.g., “https://archive.org/details/worksofrevjonath16swif/page//mode/1up”; the page is supposed to be between / /. Both the 1 August and the current revisions have this issue. J3133 (talk) 17:18, 8 September 2023 (UTC)Reply

──────────────────────────────────────────────────────────────────────────────────────────────────── @J3133: I see! You know, you could have saved a lot of time by just pointing that out at the start. @Benwing2: have you made any change to "Module:quote" which means that |pageref= is not being passed on properly by {{RQ:Swift Directions to Servants}} to {{RQ:Swift Works}}? Earlier on you said that {{RQ:Swift Works}} "has |page= before |pageref= in the definition of |pageurl= when it should be the other way around", but I don't see why this should be causing any error, since |pageref= is only used with |pages=. Since |page= shouldn't be used at all, the template should skip |page= and display the value of |pageref=. — Sgconlaw (talk) 17:30, 8 September 2023 (UTC)Reply

@Sgconlaw I did not make any changes to Module:quote that would affect how |pageref= is being passed on; in any case, {{RQ:Swift Directions to Servants}} directly calls {{RQ:Swift Works}} without going through Module:quote. The issue is that {{RQ:Swift Directions to Servants}} sets |page= to a defined but blank value, and the use of {{{page|{{{pageref|...}}}}}} in {{RQ:Swift Works}} says "use |page= if it's defined, otherwise use |pageref=". Here |page= in {{RQ:Swift Works}} is defined and set to a blank value, so that blank value is set as |pageurl=, which is why |pageref= ends up being ignored. You either need to invert the order or use something like {{#if:{{{page|}}}|{{{page|}}}|{{{pageref|}}}}} if you really want |page= processed first. Benwing2 (talk) 21:00, 8 September 2023 (UTC)Reply
@Benwing2: thanks for the explanation. I'm surprised that setting "{{{page|{{{1|}}}}}}" as the value for |page= in {{RQ:Swift Directions to Servants}} means the parameter is defined but blank; I thought that if no value is specified for either |page= or |1= (i.e., that parameter is not used by an editor) it would remain undefined. So, to be clear, in quotation templates (like {{RQ:Swift Works}}) which are to be called by other quotation templates, we can't use {{{page|{{{pageref|{{{1|}}}}}}}}} but would either have to use:
  • {{{pageref|{{{page|{{{1|}}}}}}}}}; or
  • {{#if:{{{page|}}}{{{1|}}}|{{{page|{{{1|}}}}}}|{{{pageref|}}}}}?
If {{{pageref|{{{page|{{{1|}}}}}}}}} were used, wouldn't we get the same problem of |pageref= in {{RQ:Swift Directions to Servants}} being interpreted as defined but blank? — Sgconlaw (talk) 21:25, 8 September 2023 (UTC)Reply
@Sgconlaw Yes, this is one of the reasons why templates suck and Lua is better. Templates have all sorts of weirdnesses, e.g. named parameters automatically strip whitespace from both ends but numbered parameters don't (who knows why). You are right that if we reversed the order we'd run into a similar issue, so in general yes we have to use the {{#if:}} form in any template meant to be called by another template. Benwing2 (talk) 21:47, 8 September 2023 (UTC)Reply
@Benwing2, J3133: OK, I've updated {{RQ:Swift Works}}, and {{RQ:Swift Directions to Servants}} now appears to be working. — Sgconlaw (talk) 21:02, 9 September 2023 (UTC)Reply