PHP 5.3 breaks object-valued by-reference parameters, which is used in uc_aac.module, _uc_aac_calculate() producing the error

warning: Parameter 2 to uc_attribute_cart_item() expected to be a reference, value given in /usr/home/halon/includes/module.inc on line 483.

To fix it, replace

module_invoke_all('cart_item', 'load', $item);

with

foreach (module_list() as $module) {
    $func = $module .'_cart_item';
    if (function_exists($func)) {
      $func('load', $item);
    }         
}

Cheers
Anders
Halon Sec.

CommentFileSizeAuthor
#1 uc_aac.patch548 bytesdesh

Comments

desh’s picture

Title: Patch for PHP 5.3, to make price update work » Patch for PHP 5.3, to make price update work (patch included)
StatusFileSize
new548 bytes

I figured including an actual patch would be good style, so behold. Download it to the uc_aac folder (latest stable, uc_aac-6.x-2.0), and run

patch < uc_aac.patch

Take care
Anders Berggren
Halon Security

jantoine’s picture

Status: Active » Fixed

desh,

Thanks for the patch. It has been committed to the 6.x-2.x branch.

Cheers,

Antoine

khizerjalal’s picture

Status: Fixed » Closed (won't fix)

HI, the automatic calculation of the price works fine but along with that its creating a lot of problems. Like in my case

1) i have more then one attributes available for a product, when one attribute is selected the price changes, so far so good, but when i choose option from another attribute it cannot be selected and is automatically deselected :S

2) ajax attribute calculator is not so compatible with uc option images. since i already uses javascript/ ajax on the product page and the same is used by automatic calculation, it creates a conflict and one of them doesnt works at all .. Looking forward for reviews.

/ Khizer Jalal

khizerjalal’s picture

Works fine, however to make it compatible with custom price module, on php version 5.3 we get another warning after making that change i.e:

"warning: Parameter 2 to uc_custom_price_cart_item() expected to be a reference, value given".

just change the function uc_custom_price_cart_item($op, &$item) on line 19 to function uc_custom_price_cart_item($op, $item)