Template talk:RQ:Swift Directions to Servants

Pageref not working
J3133 (talk) 18:06, 7 September 2023 (UTC)


 * try it now. — Sgconlaw (talk) 22:31, 7 September 2023 (UTC)


 * “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)
 * you’ll have to consult 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)
 * Which entry is throwing this error? — Sgconlaw (talk) 05:22, 8 September 2023 (UTC)
 * 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)
 * @J3133 What did you type that caused the error? Benwing2 (talk) 06:22, 8 September 2023 (UTC)
 * The error does not occur now because Sgconlaw has undone the change. J3133 (talk) 06:25, 8 September 2023 (UTC)
 * @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)
 * OK, let me have a look at and see if I can figure out what the issue is. Thanks. — Sgconlaw (talk) 11:53, 8 September 2023 (UTC)

I didn't see any obvious errors at, and I have not been able to reproduce your error. For example, produces:

Is it possible that you accidentally used page (instead of pages) with pageref? — Sgconlaw (talk) 15:45, 8 September 2023 (UTC)
 * As I mentioned, the error was before you undone your last edit. Below is that revision of the template with 122 and 122–123. The issue with pageref not working remains (your example links to “https://archive.org/details/worksofrevjonath16swif/page//mode/1up”).

J3133 (talk) 16:23, 8 September 2023 (UTC)
 * I can see why you triggered the error. You typed both page and pages, 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 and pages at all—care to explain?) — Sgconlaw (talk) 16:32, 8 September 2023 (UTC)
 * I did not type “ page= ” and “ pages=}} ”. I typed 122 and 122–123 but it cannot be reproduced accurately here unless you revert to that revision. J3133 (talk) 16:35, 8 September 2023 (UTC)
 * 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:
 * — Sgconlaw (talk) 16:43, 8 September 2023 (UTC)
 * 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)
 * yeah, but I'm getting confused about what issue you're trying to raise. It seems like a non-issue.
 * 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.
 * 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.
 * 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)
 * 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)
 * 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)

I see! You know, you could have saved a lot of time by just pointing that out at the start. have you made any change to "Module:quote" which means that pageref is not being passed on properly by to ? Earlier on you said that "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)


 * @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  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 you really want page processed first. Benwing2 (talk) 21:00, 8 September 2023 (UTC)
 * thanks for the explanation. I'm surprised that setting " " as the value for page in 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 ) which are to be called by other quotation templates, we can't use   but would either have to use:
 * ; or
 * If  were used, wouldn't we get the same problem of pageref in  being interpreted as defined but blank? — Sgconlaw (talk) 21:25, 8 September 2023 (UTC)
 * @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)
 * OK, I've updated, and now appears to be working. — Sgconlaw (talk) 21:02, 9 September 2023 (UTC)
 * OK, I've updated, and now appears to be working. — Sgconlaw (talk) 21:02, 9 September 2023 (UTC)