You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks like it's doing as a method of validation, but seems odd. PDF generation isn't even an optional setting so shouldn't the assumption be that there will always be a PDF to render, given the correct number?
It may not be such a huge deal since domPdf can generate PDF's quite fast, but using other means of PDF generation could be timely.
I'm hooking into the EVENT_BEFORE_RENDER_PDF to render our own PDF via Browsershot, which uses node/puppeteer, so it takes a few seconds to complete. It's very noticeable when trying to browse orders or generate a URL.
I'm able to bypass it, for now at least, while browsing orders in control panel with this snippet below in the EVENT_BEFORE_RENDER_PDF event which will still output a working Download PDF button, and valid PDF url.
if (empty($request->queryParams['number'])) {
return;
}
Additional info
Craft version: 3.2.10
Commerce version: 2.1.11
The text was updated successfully, but these errors were encountered:
@lukeholder FYI, while your fix did address the PDF rendering on every order page (and anything that uses order.pdfUrl) for me, it it also prevented the "Download PDF" button showing up on any order.
It's not showing up due to, literally any template path I pass into Order PDF Template not passing $view->doesTemplateExist($file)
Description
PDFs are being rendered upon visiting the order details screen in the control panel or by calling
order.pdfUrl
in a template. Is this right?commerce/src/elements/Order.php
Line 1044 in f17c5e3
Looks like it's doing as a method of validation, but seems odd. PDF generation isn't even an optional setting so shouldn't the assumption be that there will always be a PDF to render, given the correct number?
It may not be such a huge deal since domPdf can generate PDF's quite fast, but using other means of PDF generation could be timely.
I'm hooking into the
EVENT_BEFORE_RENDER_PDF
to render our own PDF via Browsershot, which uses node/puppeteer, so it takes a few seconds to complete. It's very noticeable when trying to browse orders or generate a URL.I'm able to bypass it, for now at least, while browsing orders in control panel with this snippet below in the
EVENT_BEFORE_RENDER_PDF
event which will still output a working Download PDF button, and valid PDF url.Additional info
The text was updated successfully, but these errors were encountered: