spree-contrib / spree_print_invoice

Create a PDF invoice for Spree orders.
http://guides.spreecommerce.org
BSD 3-Clause "New" or "Revised" License
91 stars 239 forks source link

Logo not found for logos in public folder. #75

Closed tvdeyen closed 9 years ago

tvdeyen commented 9 years ago

The default spree admin_interface_logo is defaulted to logo/spree_50.png and resist in the app's public folder. This plugin takes the Spree::Config[:admin_interface_logo] as default value for it's logo_path. Nice!

But, unfortunately this is broken, because the pdf writer only finds files known to Rails asset pipeline from the assets folder.

This is easily fixed, with moving the print logo into the assets folder, sure, but it feels a bit strange, since the spree default logo breaks this behavior.

tvdeyen commented 9 years ago

Yes, there is File.exist? check, but since the asset finder returns nil and File.exist? takes a String we get a TypeError: no implicit conversion of nil into String if the logo cannot be found.