Open sshaw opened 4 years ago
Can you provide more information for reproduction? Are you using :file
inside or outside of the header/footer options?
Are you using :file inside or outside of the header/footer options?
It's possible to use file
in header
/footer
? Seems like a no.
The problematic config looks mostly like this:
render pdf: "a_file",
file: "path/to/a/file",
header: {
html: {
template: "header",
locals: {
current_user: current_user,
}
}
},
footer: {
html: {
template: "footer",
locals: {
current_user: current_user,
}
}
}
When file
is replaced with template
or when file
is kept and header
/footer
are removed, it works. Rails 5.2.3
Issue description
See title. This
NoMethodError
is never propagated to the caller. I had to do some debugging:It only seems to occur when the aforementioned options are combined.
Expected or desired behavior
It's not clear from the docs that these cannot be used together (really makes sense for header/footer to support file option too) but if they cannot a check should be made and an
ArgumentError
raised. Exception should definitely not be swallowed which appears to be happing now as prior to debugging my logs contained nothing and action returned a 0-sized PDF response.System specifications
wicked pdf 1.4.0 but seems to occur in 2.1. Since error is not propigated not 100% as I get error rendering but did not debug under 2.1
wkhtmltopdf version (output of
wkhtmltopdf --version
):wkhtmltopdf 0.12.5 (with patched qt)
platform/distribution and version (e.g. Windows 10 / Ubuntu 16.04 / Heroku cedar):