The attached patch against DRUPAL-6--2 adds support to the print.module on the webform-submission-navigation links of the individual submission views. When the patch from #520682: Support print.module on results overview table is applied, the overview table may provide the link "Print" in addition to "View" for each submission. Admins will see "Previous submission" and "Next submission" links on each "View" or "Print" page. With this patch, the "Print" pages will provide these links to the printer-friendly versions instead of the normal nodes.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | webform_print.patch | 4.69 KB | quicksketch |
| #10 | webform-6.x-3.x_print.520722.patch | 3.65 KB | roball |
| #6 | webform_print.patch | 2.11 KB | acrollet |
| #5 | node vs. print.png | 55.46 KB | roball |
| #3 | webform__print__520682-HEAD.patch | 3.65 KB | roball |
Comments
Comment #1
roball commentedHm, the patch was missing - here it is. Tested successfully with Webform 6.x-2.8.
Comment #2
quicksketchNew features are only being added to the 3.x branch (2.x is bug fixes only). If you can update this for the 3.x branch I'll be happy to add it. I'd suggest that you use a cleaner mechanism than
if (preg_match("/^q=print\//", $_SERVER['QUERY_STRING'])) {though. How aboutif (arg(0) == 'print') {?Comment #3
roball commentedOK - here is the patch against the HEAD branch (6.x-3.x-dev version), merged with #520682: Support print.module on results overview table. Would be great to get it committed.
What's bad with using
preg_match()?(arg(0) == 'print')won't work on sites having the Drupal root directory accessed as a sub directory, resulting in URLs like www.yourdomain.tld/drupal/print/123/submission/456.Comment #4
quicksketchSure it will, arg(0) gets you the first part of the "Drupal path", and works when Drupal is installed in a subdirectory and when clean URLs is on or off.
Comment #5
roball commentedSorry - that was my feeling when I recognized that
(arg(0) == 'print')didn't work on my site. For example, at https://www.iseki-food.eu/drupal/print/183/submission/130arg()returnswhile
$_SERVER['QUERY_STRING']returnsso
arg()can't be used to determine if the current URL has been parsed through the print.module, by replacing "node" in the URL by "print". Using $_SERVER['QUERY_STRING'] works, for both possible Clean URLs states.Comment #6
acrollet commentedre-rolled with arg(0) against latest HEAD - tested working on a site that exists in a subdirectory...
Comment #7
roball commentedAdrian, please believe me - as posted in #5, arg(0) does NOT work on some sites, including the one I was referring to! My patch @ #3 DOES work, however and was fully tested successfully with all possible different scenarios. Too bad if a non-working patch would be prefered over a working one.
Comment #8
roball commentedquicksketch, did you change your plans to commit this patch to HEAD?
Comment #9
quicksketchNo I'll include it soon, I've just been extremely busy and working on Webform is always a bit of a daunting task. I reduced the issue queue from 700 down to 500 the past week, hopefully I'll get to implementing feature requests here again pretty soon.
Comment #10
roball commentedExcellent quicksketch! Thanks for all your work on this must-have module.
The attached patch has been tested successfully against the latest 6.x-3.x-dev version.
Comment #11
quicksketchI've totally borked this patch since it was last rolled, since a lot of things changed with #181077: Printable page for webform submissions. I updated it for the very latest and gave it a shot. It's pretty slick I have to say. I put in some extra help to make it so that we also support Print PDF, since it's nearly identical in implementation. So now we can print and PDF print submissions, pretty cool.
Comment #12
quicksketchComment #13
roball commentedThank you very much for committing the patch :-) Webform 6.x-3.x-dev (2010-Jan-22) is working great!
Comment #15
irozner commentedi'm confused...
which patch i need to put for version 2.8?
can't wait for the 3.x
thanks
Comment #16
roball commentedirozner, my patch from reply #1 should work with the 2.x branch. The feature is officially available only in the 3.x branch.
Comment #17
roball commentedHm, I no longer see the "Print" entries with Webform 3.8. Any clues why?
Comment #18
quicksketchPlease file a new issue for support requests or bug reports. This "feature request" has long been fixed.