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

jcnventura’s picture

Status: Active » Postponed (maintainer needs more info)

Is this in all the printer-friendly pages or only in the PDF?

João

luti’s picture

In both

jcnventura’s picture

Can you provide a URL to the site in question?

João

luti’s picture

It 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?

jcnventura’s picture

I 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

luti’s picture

Sent

jcnventura’s picture

Can 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

luti’s picture

I'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().

jcnventura’s picture

Status: Postponed (maintainer needs more info) » Fixed

Yes, 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

luti’s picture

Thanks to you for a really quick responses.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.