Page MenuHomePhabricator

Wikisource: Replace ElectronPDF with WSExport PDF support
Closed, ResolvedPublic3 Estimated Story Points

Description

NOTE: This task is dependent upon T256392 being completed first.

As a Wikisource user, I want the replacement of ElectronPDF with WSExport PDF functionality to be investigated, so it can be determined if it the change will result in less errors and issues associated with such downloads.

Background: When users access the "Download as PDF" from the sidebar in Wikisource, they are using ElectronPDF. In other parts of Wikisource, the user uses WSExport. We believe that many of the issues associated with PDF downloads may be related to ElectronPDF. For many users, ElectronPDF does not work at all, so it provides very little value (if any) to the user experience. Meanwhile, WSExport does properly manage the PDF download experience. Thus, the purpose of this investigation is to determine if we should make this change, how we can make it, the level of effort, and what sort of improvement to the user experience we can expect with such changes.

Documentation:

Acceptance Criteria:

  • Replace usage of ElectronPDF with WSExport for 'Download as PDF' links in left sidebar of main namespace

Event Timeline

ifried renamed this task from Wikisource: Investigate replacing ElectronPDF with WSExport PDF support [placeholder] to Wikisource: Investigate replacing ElectronPDF with WSExport PDF support.Jun 18 2020, 10:45 PM
ifried renamed this task from Wikisource: Investigate replacing ElectronPDF with WSExport PDF support to Wikisource: Replace ElectronPDF with WSExport PDF support.Oct 8 2020, 6:11 PM
ifried updated the task description. (Show Details)
ARamirez_WMF set the point value for this task to 3.Oct 8 2020, 6:12 PM

When users access the "Download as PDF" from the sidebar in Wikisource, they are using ElectronPDF.

@ifried: Any references for the claim that https://github.com/fraserxu/electron-pdf has been or is used anywhere at all on Wikimedia sites?

For many users, ElectronPDF does not work at all

Any further information that allows understanding problems?

The ElectronPDF in question is this extension: https://www.mediawiki.org/wiki/Extension:ElectronPdfService (the Github link above is not correct).

It replaces the Collection extension's PDF export link in the sidebar.

This task is is to turn both these extensions off for all Wikisources, but only after T256392 is done.

This task is is to turn both these extensions off for all Wikisources, but only after T256392 is done.

Thanks for clarifying! In that case this task should depend on the other task.

I have added a note in the general description about the dependency.

Change 651890 had a related patch set uploaded (by Samwilson; owner: Samwilson):
[operations/mediawiki-config@master] Disable Collection and ElectronPdfService exts for all Wikisources

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

The patch for T256392 (now merged) does the actual work of removing the PDF link, and the above patch adds some comments to the config about the two extensions needing to stay being loaded in that order.

Change 656648 had a related patch set uploaded (by Samwilson; owner: Samwilson):
[mediawiki/extensions/Wikisource@master] Remove the ElectronPdfService link from sidebar

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

Moving back to review because I forgot to remove the actual electron PDF link! Above patch does.

Change 656648 merged by jenkins-bot:
[mediawiki/extensions/Wikisource@master] Remove the ElectronPdfService link from sidebar

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

@Samwilson Testing locally, I notice that if only the ElectronPdf extension (and not the Collection extension) is installed, the ElectronPdf link does appear.

I guess because it has its own <nav>, different from Collection, with id=p-electronpdfservice-sidebar-portlet-heading.

Looking in the production config, I think zhwikisource, srwikisource and zh_min_nanwikisource are the only wikisources with only ElectronPdf installed.

ws+electron_content.png (588×155 px, 25 KB)

Change 651890 merged by jenkins-bot:
[operations/mediawiki-config@master] Add notes about load order of Wikisource and Collection extensions

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

Mentioned in SAL (#wikimedia-operations) [2021-01-21T19:21:48Z] <urbanecm@deploy1001> Synchronized wmf-config/CommonSettings.php: 0b46c9f1f75fc773f57bfa70521c9eaf20410b9e: [no-op] Add notes about load order of Wikisource and Collection extensions (T255790) (duration: 01m 11s)

There are a number of ways of configuring the Collection and ElectronPdfService on a wiki, but I have tested the ways it is configured on production (from what I can work out from the production configs).

On the majority of wikis, the PDF download link created by Collection (and overwritten by ElectronPdfService) is removed by the Wikisource extension.

The other links created by Collection and ElectronPdfService are untouched (e.g. the "Create a book" link in the screenshot). This includes download links for formats other than PDF (e.g. txt, odt). But, I don't believe such links are used anywhere on production.

Without Wikisource:

without_wikisource.png (111×134 px, 5 KB)

With Wikisource:
with_wikisource.png (160×132 px, 7 KB)

This only happens in namespaces where Wikisource is loaded (e.g. Main, Index, Page). The Collection/ElectronPdfService links are untouched on other namespaces (e.g. MediaWiki). This might be a bug in Collection/ElectronPdfService, but I guess it is not our responsibility.

I believe it is implemented in such a way as to be independent of what skin is used. So I mainly tested Vector, but I briefly tested it on Modern, Monobook and Timeless (Minerva does not show the links).

As mentioned in T255790#6764582, there are three wikisources where we will still see two PDF download links. I have raised T272674.

Test Environments

When one downloads books via the sidebar links, the PDF option now uses WS Export.

As for the other issues mentioned: The issue of ElectronPDF links still appearing in some wikis is covered in another ticket (T272674). Meanwhile, namespaces such as Main & Index are outside the scope of this ticket, as it was meant to improving ebook exports specifically.

For these reasons, I'm marking this as Done.