I've updated the module (1.10 -> 1.11), and my theme images (logo, backgrounds...) are not found by Print module anymore.
No wonder, as the new version is obviously looking for them in a wrong place (for example, a missing sites/all/modules/print/images/logo.jpg is logged), appending its own path instead of theme path (should be sites/all/themes/mytheme/images/logo.jpg).
I've resolved the issue creating a link to images folder (in print folder), but it can be only a temporary solution, as probably something else can go wrong as well (due to the wrong path to my theme).
Comments
Comment #1
jcnventuraIs this in all the printer-friendly pages or only in the PDF?
João
Comment #2
luti commentedIn both
Comment #3
jcnventuraCan you provide a URL to the site in question?
João
Comment #4
luti commentedIt is a test site, without public access. I won't put a new version on a production site as long as I am not sure it will not break something...
Which data (information) do you need?
Comment #5
jcnventuraI need the HTML of the original and of the printer-friendly pages. You can send it to my private email. You can that it in the MAINTAINERS.txt file in the module.
João
Comment #6
luti commentedSent
Comment #7
jcnventuraCan you try to comment out line 577 of print.pages.inc? It contains a call to theme('print_node').
Other than your own theme being the one re-writing the image paths, I'm totally lost on the origin of your problem. If you want to help debug it, find out where in the _print_generate_node() function between lines 493 and 595 is the $content variable changed to these strange paths.
That would help to narrow down where the origin of the problem is..
João
Comment #8
luti commentedI've found it.
It was a path_to_theme() function in my custom print.tpl.php file (located in my theme folder). This function now returns a path to print module instead of a path to my theme folder (as it did up to now).
I've resolved it adding a global $theme; and using a drupal_get_path("theme", $theme) function instead of path_to_theme().
Comment #9
jcnventuraYes, there used to be a call to init_theme() before including the template, that got dropped as it wasn't doing much..
Since that call no longer exists in Drupal 7, it's actually better to do it like you're doing now. In the meantime, I'll add the init_theme() back.
Thanks for the detective work on your part.
João
Comment #10
luti commentedThanks to you for a really quick responses.