Patch for "Call-time pass-by-reference has been deprecated" warning

Project:Multi-buy
Component:Code
Category:
Priority:normal
Assigned:Unassigned
Status:patch (to be ported)
Description
Project: 
uc_multibuy

This patch fixes the following warning:

Warning: Call-time pass-by-reference has been deprecated in D:\wamp\www\drupal\sites\all\modules\uc_multibuy\uc_multibuy.module on line 276

It seems to be related to using PHP5.

PreviewAttachmentSize
uc_multibuy_2_2_warning_fix.diff795 bytes
tjark's picture
Offline
Joined: 01/07/2010
Juice: 2
Pass by reference warning (it's not just a warning...)

I use PHP 5.3, Drupal 6.15 and Ubercart 6.x.2.2
On various occasions I get warnings about parameters that are expected to be a reference. In uc_product.module, in uc_store.module, uc_taxed.module, uc_credit.module etc.

I fixed the warnings by removing the proper '&' in every function definition which generates a warning.
This 'warning' was the reason for pictures not being shown next to my products.

It appears that PHP5.3 and the way referenced parameters are handled now has a major impact on Ubercart's functioning.

Personally I can not oversee which functions and which parameters will be affected so right now I can not provide a solution.

Maybe one of the supporting engineers can solve this in the next version ?

I expect that this problem affects newbees (like me) as they start out with the latest PHP. And this group is less likely to solve these problems by themselves.

If I can be of any help in that process, just send a post.

TR
TR's picture
Offline
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3424
Re: Pass by reference warning (it's not just a warning...)
Assigned to:tjark» TR

The issue you replied to is about a problem with uc_multibuy. If you have a problem elsewhere you should open a new issue. But first ...

Note that according to http://drupal.org/requirements

Quote:

PHP 5.3 is not currently supported by Drupal 6.x

While Ubercart is making an effort to support PHP 5.3, until Drupal core fully supports it there's not much we can do to eliminate all errors.

You should review the existing discussion about PHP 5.3 and references at http://drupal.org/node/574066 . That issue is now closed because the proposed patch seemed to fix the problem, and no-one complained that it broke anything else. If, after reading through that thread, you think there are still places in Ubercart that were not fixed, you should re-open that thread by marking the issue as "active" then citing lines of code which are wrong - or preferably posting a patch to correct the problems.

<tr>.