Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
On clicking the "Print" button with the "Open in new window" and "Close window after sending to printer" options set, using Chrome, the new window opens and immediately closes without printing. On trying again the new window opens but no print dialog opens.
See http://stackoverflow.com/questions/7652981/chrome-window-print-window-cl... for a discussion of this problem outside Drupal.
Comment | File | Size | Author |
---|---|---|---|
#7 | print-2324829-1.x-backport-7.patch | 789 bytes | mradcliffe |
#2 | print-chrome_close_window_breaks_print-2324829-2.patch | 1012 bytes | azovsky |
Comments
Comment #1
hughworm CreditAttribution: hughworm commentedI have successfully patched print.pages.inc based on solution from darven in http://stackoverflow.com/questions/7652981/chrome-window-print-window-cl... : I replaced window.close() with setTimeout(function(){window.close();}, 1).
Line 180 then becomes:
The original forms the following script:
The patched version forms this script:
I successfully tested this in Chrome, FFX and IE11.
Comment #2
azovsky CreditAttribution: azovsky commentedThanks @hughworm!
Yours solution is working for me.
I wrapped it in a patch file.
Comment #3
calebtr CreditAttribution: calebtr commentedThis patch applies and works as described.
Since no one else seems to be testing this in about 9 months, I'm setting RTBC in hopes of moving it along.
Comment #4
evgeny.chernyavskiy CreditAttribution: evgeny.chernyavskiy commentedI can confirm this patch fixes the issue.
Comment #5
BrightBoldThis fixed the problem for me as well.
Comment #6
sdowney2002 CreditAttribution: sdowney2002 commentedThis patch works for me, as well.
Comment #7
mradcliffeHere's a backport of the patch in #2 for 7.x-1.x.
Comment #8
sureshcj CreditAttribution: sureshcj commentedThanks @hughworm!
The #2 patch work for me...
Comment #9
jcnventura CreditAttribution: jcnventura commentedThanks everyone!
Comment #13
buckydawg CreditAttribution: buckydawg commentedgood day how do i run this patch