stable

Clone or download

Read-only

fix: patch infinite loop bug when image not found

There is a bug in PrintJS that breaks the preview when an image in the document can't be found. It happens because the lib ends up waiting indefinitely for the image to load, while it will never load. Since PrintJS is no longer maintained, and that this issue is known since a couple of years (5 to be exact), and that the pull-request fixing it will likely never be merged, we have to find a way around. The proposition is to `pnpm patch` our dependency to print-js with the code of the PR fixing the bug. How to test: - make post-checkout - In the pdftemplates admin, add an image to one of your templates, insert a couple of characters inside the url so it won't be found. - Click on [Preview] --> The preview opens --> A "broken image" image is shown in place of the image. Part of story #38630: Export to file Change-Id: I32217a0155c1627240d634907fff928adb3c6673

Modified Files

Name
M lib/frontend/print-as-pdf/package.json +5 −0 Go to diff View file
A lib/frontend/print-as-pdf/patches/print-js@1.6.0.patch +13 −0 Go to diff View file
M lib/frontend/print-as-pdf/pnpm-lock.yaml +8 −2 Go to diff View file
M lib/frontend/print-as-pdf/src/print-as-pdf.test.ts +1 −1 Go to diff View file
M lib/frontend/print-as-pdf/src/print-as-pdf.ts +1 −1 Go to diff View file