After upgrade, Printer-friendly pages no longer works
| Project: | Printer, e-mail and PDF versions |
| Version: | 5.x-4.3 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Hi. I just upgraded to 5.15, and my printer-friendly pages no longer worked. I thought it was because I needed the latest version of Print, so I then upgraded the module to Print 5.x-4.3 - and still have the same problem.
I don't believe I'm getting any error (I am getting some PHP errors in the logs, but don't think they are related to Print), and the URL is properly configured: http://www.mysite.com/print/4288 (for example) - but Print does not work. That URL simply fetches the home page of my site, i.e., "node."
What could be wrong here? It actually seems to be an issue with either 5.15, or else something on the server - but what? My other modules are working, mostly (except for SimpleFeed, which seems hinky, too - but I think that may be the Feedburner issue). Can I do anything with the code of Print somehow to get this going again? It was working very nicely before the upgrade to 5.15.
Thanks.

#1
(Above, I meant, of course, that "I just upgraded to Drupal 5.15." Sorry.)
#2
Are you getting "page not found"?
I was just wondering if this was related to my issue: http://drupal.org/node/379490
#3
No, it's just loading the home page, without any error that I can find. That means, I am hazarding to guess, an "if-else" loop in which no conditions are met.
Maybe Print can't find the "print.tpl.php" file, which is the page that gets opened when the link is clicked (after Drupal first checks for user-generated-and-styled printer-friendly template pages) - I think that's what's going on, anyway - although I don't know why.
It's interesting, though, that I'm having a very similar problem, in that 5.15 and Print work fine locally - just not on the Production server. I'm wondering if this is a security thing or something....
#4
Hi,
Can you try the following:
1. Disable all the print modules
2. In the uninstall tab, uninstall all modules
3. Re-enable all the print modules
And tell me if you still have the same problem?
João
#5
For #2, are you asking me to uninstall ALL modules? And then just install Print alone and see if it works? If so, is there any other way to check this? That's a lot of work....
BTW, I've only installed the one Print module - printer-friendly pages.
#6
Sorry for not being thorough.. Just uninstall all the print modules (using Drupal's uninstall tab).. This will execute the hook_uninstall feature of the modules and make sure that you don't have 'trash' lying around that could cause this behavior.
And maybe also, do step 2.5: get a fresh download of the module, delete all the existing module files and untar the fresh download in the modules directory.
What I am trying to do here is to get you on a level in which I can relate, and if your problem is still showing after this, then something in your site/the module must be the problem.
Are you using MySQL?
João
#7
OK, thanks - I'll do that, including 2.5, and then I'll re-post. Yes, I'm using MYSQL.
#8
Hi - thanks for responding. Unfortunately, the same thing still happens: no error message, and the proper URL is in the URL bar (i.e., "http://www.mysite/com/print/4288") - but it fetches the Home Page, and does not open the print dialogue (I have that setting set).
I've tried fooling around with settings - HTML vs. Javascript, blocks vs. non-blocks, etc., but still the same thing happens. I'm pretty sure it's not your module, nor the Drupal upgrade to 5.15, because as I said, on my local test sites, this works fine. It's surely something on the server - but what could it be?
Couldn't I in fact just write a simple PHP - or even Javascript! - function to do this, though, sending only the current node to print? I would think so, but of course I'd rather get this module working again....
#9
(Maybe my site doesn't understand the "/print/" part of the URL? What is happening there? And why wouldn't it give a "Page not found" error instead?
Just curious....)
#10
It should indeed return the 'Page not found', unless something is redirecting all the print/* paths to the main page (or something similar).
Can you try to edit the PRINT_PATH in print.module to something else, and then run update.php to make sure that drupal rebuilds the paths.
As you mentioned, maybe it's easier to make sure that your theme's print.css hides all the non-content parts, and to use the window.print() Javascript to print it (http://www.javascriptkit.com/howto/newtech2.shtml)
João
#11
Thanks very much! That did it. It must have been an error with the paths; I'm pretty sure I ran update.php after the Drupal and Print upgrades, but it's possible I forgot to run it after upgrading Print. Would that cause this kind of behavior? I'm pretty sure I ran update.php at least once after upgrading both SimpleFeed and Print, though; wouldn't that have been enough?
And then, I know I ran update.php after the Drupal 5.15. upgrade, and this module wasn't working at that point, either. Hmmm.
Oh, well. It's fixed now, and I really appreciate your help; sorry if this was my error. I do really like this module and am glad to get it going again, because I hope to add the PDF function soon as well.
Thanks again!
#12
I'm glad to know that it worked for you...
Did you get to change the PRINT_PATH to something else, or was it fixed by simply running update.php?
João
#13
I did change PRINT_PATH, and then I ran update.php, as per your instructions - so I'm not sure whether just running update.php would have fixed it or not.
But as I said above, I know I did run it when I upgraded to 5.15, and printer-friendly pages didn't work at that point, either, with the same error (although it was an earlier version of Print at that point).
Thanks again -
#14
If you ever have some time free, you can try setting the PRINT_PATH back to the default.. I am pretty sure that you'll get the frontpage redirection again.
I say this because I am convinced that there's some strange rule somewhere in your setup that redirects the print URLs to the frontpage.
On the other hand, if setting it back to the default works, then it was some kind of transient problem (the ones that are really, really hard to fix).
The annoying thing is that you'll have to keep changing the PRINT_PATH everytime you update the module.
João
#15
Thanks, I'll try that sometime. At least I know how to fix it now, so that's great.
#16
Automatically closed -- issue fixed for 2 weeks with no activity.