Page MenuHomePhabricator

Regression: New Vector adds all sidebar when exporting to PDF
Closed, ResolvedPublic3 Estimated Story Points

Description

Description

When exporting to PDF (i.e. [[:eu:Juan Sebastian Elkano]]) the sidebar is added as the first page of the file. This happens even if you are using the legacy vector mode.

Steps to reproduce confirmed problems:

  • Go to: https://en.wikipedia.org/wiki/Berlin with legacy vector off
  • Use browser print option

    Expected: The sidebar menu does not appear in the print

    Observed: The sidebar menu appears in print
  • Using a wiki where modern Vector is the default e.g. Basque Wikipedia
  • Use "download as pdf" in the sidebar

    Expected: The sidebar menu does not appear in the print

    Observed: The sidebar menu appears in print

Note: what user preference you have enabled should have no impact on the download as pdf link in this case.

Notes

This does not occur if the Download as PDF option is used in a site that has legacy mode as the default regardless of any user preference e.g. the sidebar will show on fr.wikipedia.org but not en.wikipedia.org

Note the comment in T265217#6576790 relates to T266559 a different problem to this one.

Developer notes

We need to update the print stylesheet for modern Vector.

I would recommend to fix that we add #mw-panel to the rules in https://github.com/wikimedia/mediawiki/blob/e49dd2476799cc042c74969bf427213f0606b958/resources/src/mediawiki.skinning/commonPrint.css#L31

QA Instructions

QA Results - Beta

ACStatusDetails
1T265217#6783749
2T265217#6783749

QA Results - Prod

ACStatusDetails
1T265217#6841028
2T265217#6841028

Event Timeline

Aklapper triaged this task as Medium priority.Oct 24 2020, 9:19 PM
Aklapper added subscribers: Jdlrobson, Od1n.

Copying tags and priority from duplicate T266244

Problem with not only new vector. For example, enwiki, ruwiki.
But in some articles, everything is fine: enwiki.

ovasileva renamed this task from New Vector adds all sidebar when exporting to PDF to Regression: New Vector adds all sidebar when exporting to PDF.Oct 26 2020, 11:00 AM
ovasileva raised the priority of this task from Medium to High.

This does not occur if the Download as PDF option is used in modern mode

Indeed, it occurs in the modern mode. Test it at Basque Wikipedia.

I can only replicate in new Vector. For wikis that are running new vector as default (e.g. eu and fr) please note that user preference has no impact on the Download as pdf feature. If you have opted out of new Vector you are still printing via old Vector when using ElectronPdf.

It looks like what happened here is during the DOM changes the sidebar is no longer underneath #mw-navigation so the rule in core hiding it no longer applies

To fix this issue, we need to add a rule to resources/skins.vector.styles/common/print.less to hide #mw-panel

Problem with not only new vector. For example, enwiki, ruwiki.
But in some articles, everything is fine: enwiki.

Can you expand on the issue you are seeing here @Iluvatar ? I can't see a sidebar in the PDF output of those links and that makes sense to me as both English and Russian are still using uses the default (old) Vector skin for anonymous users. Implementation-wize, DownloadAsPdf creates a session with an anonymous user and runs CTRL+P. Could you share some of the PDFs you have generated via DownloadAsPdf ?

Can you expand on the issue you are seeing here @Iluvatar ? I can't see a sidebar in the PDF output of those links and that makes sense to me as both English and Russian are still using uses the default (old) Vector skin for anonymous users. Implementation-wize, DownloadAsPdf creates a session with an anonymous user and runs CTRL+P. Could you share some of the PDFs you have generated via DownloadAsPdf ?

Several unregistered readers reported via social networks that export as PDF not working: files are broken (files cannot be opened). It doesn't work for me too (even via pdf repair tools), see links above and files.

Or is it another problem?

Can you expand on the issue you are seeing here @Iluvatar ? I can't see a sidebar in the PDF output of those links and that makes sense to me as both English and Russian are still using uses the default (old) Vector skin for anonymous users. Implementation-wize, DownloadAsPdf creates a session with an anonymous user and runs CTRL+P. Could you share some of the PDFs you have generated via DownloadAsPdf ?

Several unregistered readers reported via social networks that export as PDF not working: files are broken (files cannot be opened). It doesn't work for me too (even via pdf repair tools), see links above and files.

Okay thanks for clarifying - this looks like a different problem - T266559 - as these PDFs seem to be corrupted files.

ovasileva set the point value for this task to 3.Oct 28 2020, 5:26 PM

This does not occur if the Download as PDF option is used in modern mode

I am seeing it in both modern mode

Change 658736 had a related patch set uploaded (by Nray; owner: Nray):
[mediawiki/skins/Vector@master] Move #mw-panel into #mw-navigation

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

nray subscribed.

Change 658736 merged by jenkins-bot:
[mediawiki/skins/Vector@master] Move #mw-panel into #mw-navigation

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

nray updated the task description. (Show Details)

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Big Sur
Browser: Chrome
Device: MBP
Emulated Device: NA

Test Artifact(s):

QA Steps

✅ AC1: Download the dog pdf at https://en.wikipedia.beta.wmflabs.org/w/index.php?title=Special:DownloadAsPdf&page=Dog&action=show-download-screen and ensure no sidebar shows in PDF

Screen Shot 2021-01-28 at 5.55.45 AM.png (1×794 px, 375 KB)

✅ AC2: Click the "Printable Version" link in the sidebar of https://en.wikipedia.beta.wmflabs.org/wiki/Dog?useskinversion=2 . Ensure that no sidebar appears in the print preview.

Screen Shot 2021-01-28 at 5.55.16 AM.png (940×1 px, 144 KB)

Edtadros subscribed.

Test Result - Prod

Status: ✅ PASS
Environment: enwiki
OS: macOS Big Sur
Browser: Chrome
Device: MBP
Emulated Device: NA

Test Artifact(s):

QA Steps

✅ AC1: Download the dog pdf at https://en.wikipedia.org/w/index.php?title=Special:DownloadAsPdf&page=Dog&action=show-download-screen and ensure no sidebar shows in PDF

Screen Shot 2021-02-18 at 6.39.39 AM.png (1×1 px, 564 KB)

✅ AC2: Click the "Printable Version" link in the sidebar of https://en.wikipedia.org/wiki/Dog?useskinversion=2 . Ensure that no sidebar appears in the print preview.

Screen Shot 2021-02-18 at 6.40.59 AM.png (1×1 px, 565 KB)