This module seems to have serious issues with PHP 5.3

Uploading a file to a comment causes the following error:

warning: Parameter 1 to theme_comment_upload_form_current() expected to be a reference, value given in /var/www/drupal/httpdocs/includes/theme.inc on line 617.

Worse, the upload fails. Additionally, editing a comment with an upload already on it garbles the form (see attached image) and generates the same error as above.

Am thinking this is probably critical, although the adoption of PHP 5.3 may not be that fast.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Heine’s picture

Category: bug » feature

PHP 5.3 is not supported.

Berdir’s picture

Status: Active » Needs review
FileSize
1.55 KB

Nice trick @ Heine :)

Removing the & from the theme function and also changing the form_alter() implementation in the js callback. Not sure if $form_state is for a reason explicitly an empty array but I left it like that.

mikejonesok’s picture

Thanks for the patch. Works great!

jrdixey’s picture

Would this patch break the module under PHP 5.2? I'm on Bluehost and I am pretty sure they don't do notifications in advance of PHP version upgrades, so I'd rather patch it beforehand, rather than waiting for the current version of comment_upload to fail if and when they get around to upgrading to PHP 5.3 ...

Berdir’s picture

No, it should work perfectly fine with PHP 5.2 and older versions.

Heine’s picture

Title: Errors with PHP 5.3 » Errors with PHP 5.3 - warning: Parameter 1 to theme_comment_upload_form_current() expected to be a reference.
abw’s picture

Works. Thanks!

jgrauman’s picture

FYI: The patch fixed this problem for me too...

basvredeling’s picture

Status: Needs review » Reviewed & tested by the community

The patch from #2 works fine. Confirmed by 3 people, RTBC

aharown07’s picture

Tested on D6.20 on Php5.3 and nginx web server.
Works like a charm. Maybe commit soon?

ducke’s picture

Works perfectly. Thanks!

MrHaroldA’s picture

Works like a charm! Too bad this isn't committed and released...

Bammes’s picture

Works great! Thanks!

basvredeling’s picture

Category: feature » bug
Status: Reviewed & tested by the community » Patch (to be ported)

It's been a year and a half since this patch was uploaded, is there any reason why it hasn't been committed?

Heine’s picture

Status: Patch (to be ported) » Reviewed & tested by the community
Alan D.’s picture

+1 Patch prevents errors on PHP5.3 / Drupal 6.22.

jdwfly’s picture

Please commit!

+1

basvredeling’s picture

@heine could you clarify why the patch is not ready to be tested yet and why the status of this issue has been reverted to reviewed & tested? You forgot to comment on the change in #16

php5.3 is pretty widespread and has been for quite some time now. But in this issue no progress has been made in 2 years (since the patch 's been submitted).

FYI: I mostly need this fix because comment_upload is part of the open atrium distro. Each time that gets updated I need to patch our various atrium installations to remove the errors our users are complaining about during upload. They see about 8 errors each time they upload a file via comment_upload. Would be very nice if patching the module wasn't necessary any more.

Berdir’s picture

Because RTBC is the correct status. That means it's ready to be commited. patch (to be ported) has a completely different meaning and means an already commited patch needs to be ported to another version of the module.

Please read the linked documentation pages for more information.

basvredeling’s picture

thanks, my bad...
which leaves the question: why isn't it commited?

dww’s picture

Status: Reviewed & tested by the community » Fixed

Because this module is almost entirely unmaintained. :/

However, I just tested and confirmed that this fixes lots of problems on my 5.3 test site, and yet still works fine on a 5.2 test site. Committed and pushed to 6.x-1.x. This will be out in alpha6.

basvredeling’s picture

thanks for the reply and the commit!

Status: Fixed » Closed (fixed)

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