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.
Code doesn't work with php 5.3 because of incompatible object references when generating pdfs.
Comment | File | Size | Author |
---|---|---|---|
#2 | 785364_201005031403+1000.patch | 2.46 KB | sammys |
patch_print_pdf_compatibility_php_5_3.txt | 2.48 KB | ela.m |
Comments
Comment #1
ela.m CreditAttribution: ela.m commentedComment #2
sammys CreditAttribution: sammys commentedHi there. Thanks for the bug report and patch. It most certainly fixes the problem on PHP 5.3 and has solved my problem.
Unfortunately, Drupal 6 has a base level of PHP 4 and, as a result, your patch will most likely not work because objects/arrays are not passed by reference automatically. I.e
theme()
will not send object references to thetheme_print_pdf_*()
functions in PHP 4. This will probably prevent your patch from being accepted by the maintainer.As I said, it will most likely not work so I'm leaving this as needs review pending some testing and/or patch fixing on PHP 4.
I've rerolled the patch to remove the upper directories so the patch applies with -p0.
Comment #3
Strykerraven CreditAttribution: Strykerraven commentedThanks, This worked for me.
Comment #4
chrisssi CreditAttribution: chrisssi commentedCan't get it to work because of HUNKs.
Drupal 6.17, print.module 6x 1.10 on ubuntu server 10.04 64Bit.
Program "patch" is installed and I did
patch print < xxxxx.patch
Comment #5
jcnventura CreditAttribution: jcnventura commentedActually, because of this incompatibility between PHP 5.3 and the older versions, the solution is to stop passing stuff by reference..
When Drupal 8 comes around, maybe that will use PHP 5.3 as minimum and then we can safely assume that it is safe to use references. Until then, everything will be passed by value.
I have committed to CVS a patch that removes all the by-reference arguments.
João Ventura