Page MenuHomePhabricator

"Download as PDF" on an old revision goes to Special:Book rather than Special:DownloadAsPdf
Open, Needs TriagePublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

  • Go to any old revision of a page in the namespaces 0-5, 8-9, 12-14 & 100-101.
  • Click "Download as PDF"

What happens?:

You are sent to Special:Book, which at least in the case of enwiki means an error message saying to download as PDF instead.

What should have happened instead?:

I don't know whether DownloadAsPdf supports old revisions—it should, but if not, that's a feature request, not a bug. But if it does, then clicking "Download as PDF" should take you to that, and if it doesn't, the option should just not be there. Interesting how only certain namespaces are affected by this bug, and not others.

Event Timeline

Tamzin renamed this task from "Download as PDF" on an old revision goes to [[Special:Book]] rather than Special:DownloadAsPdf to "Download as PDF" on an old revision goes to Special:Book rather than Special:DownloadAsPdf.Apr 15 2022, 2:32 AM
Aklapper added a project: Electron-PDFs.

Hi, please always include full links and clear steps to reproduce.
I assume this is about English Wikipedia. I cannot reproduce using "Printable Version": It prints an old version.

"Download as PDF" on an old revision goes to Special:Book rather than Special:DownloadAsPdf

That in itself is not a bug so I'm closing this ticket.

If you want a PDF you should click the "Printable Version". If English Wikipedia still shows "Download as PDF" that should probably be removed and be a separate task asking for removing that. See also T172488 - I guess that https://gerrit.wikimedia.org/r/620481 was supposed to fix this once upon a time.

@Aklapper Sorry, I thought these steps were clear enough. The reason I think this is a bug is a) that it is inconsistent behavior and b) that there is thus no obvious way to download a PDF of an old revision (if such a thing is possible).

("Printable version" works as expected in both cases.)

Is the "Download as PDF" function unique to enwiki? At a glance, I see it also on frwiki ("Télécharger comme PDF") and enwiktionary.

I can reproduce this bug in commonswiki as well. Steps to reproduce:

  1. Go to https://commons.wikimedia.org/w/index.php?title=Commons:Simple_media_reuse_guide/id&oldid=736821866
  2. Click Download as PDF
  3. I was directed to https://commons.wikimedia.org/w/index.php?title=Special:Book&bookcmd=render_article&arttitle=Commons%3ASimple+media+reuse+guide%2Fid&returnto=Commons%3ASimple+media+reuse+guide%2Fid&oldid=736821866&writer=rl

Here's the screenshot:

image.png (998×406 px, 24 KB)

What should have happened instead?:

  • Should never go to Special:Book, since:
Book Creator is undergoing changes

Due to severe issues with our existing system, the Book Creator will no longer support saving a book as a PDF.

Change #1057276 had a related patch set uploaded (by TheDJ; author: TheDJ):

[mediawiki/extensions/ElectronPdfService@master] Portlet: Remote download as PDF for old revisions

https://gerrit.wikimedia.org/r/1057276

From the patch commit message:

Remove Download as PDF link on old revisions, as Electron/Proton do
not support it. […]

Couldn’t they be made support it? The merged-in task T370740 highlighted that download as PDF is broken on FlaggedRevs wikis if and only if the current page has unreviewed changes. This means that the feature is broken on a large number of articles (even without oldid= in the URL), and in a confusing way – the reader looks at two articles which look the same apart from the tiny Pending changes tab at a completely different part of the page, yet one of them has a download link, the other doesn’t have one.

From the patch commit message:

Remove Download as PDF link on old revisions, as Electron/Proton do
not support it. […]

Couldn’t they be made support it? The merged-in task T370740 highlighted that download as PDF is broken on FlaggedRevs wikis if and only if the current page has unreviewed changes.

The print api Proton, can only print the current revision as of right now: https://en.wikipedia.org/api/rest_v1/#/Page%20content/get_page_pdf__title_

But it’s possible to add a query or path parameter to it that accepts a revision ID, isn’t it? It may require quite some work, of course (I don’t know how it works), I’m only talking about the possibility. (If it takes a lot of work, merging your patch as a short-term solution probably makes sense, but I hope it won’t be the long-term solution.)

But it’s possible to add a query or path parameter to it that accepts a revision ID, isn’t it? It may require quite some work, of course (I don’t know how it works), I’m only talking about the possibility. (If it takes a lot of work, merging your patch as a short-term solution probably makes sense, but I hope it won’t be the long-term solution.)

But that would be a separate issue from this and not the issue i set out to fix.

But that would be a separate issue from this

I don’t think it’s a separate issue from T370740: download as PDF is broken with FlaggedRevs, and it will continue to be broken once your patch is merged. It may be a separate issue from T306232 – in that case, the merge was inappropriate.

and not the issue i set out to fix.

Neither did I ask or expect you to fix that one – as I wrote, your patch is okay as a short-term fix, and there’s no rule that the long-term fix should be written by the same person.

Change #1057276 merged by jenkins-bot:

[mediawiki/extensions/ElectronPdfService@master] Portlet: Remove non-working download as PDF for old revisions

https://gerrit.wikimedia.org/r/1057276