I'm not sure if I selected the correct component for this (could be another module). The following errors occurred in a recent new installation from one of the release candidates of ecommerce that has now been upgraded to 5.x-3.0

We've had quite a few problems with the administration Create new transaction screen. For example, when I try to create a new transaction manually with transaction workflow completed and payment status completed, I get the following error:

Fatal error: Call to undefined function: product_unit_nice_name() in /home/pwpa/public_html/modules/ecommerce/store/store.module on line 898

Then if I try to edit the transaction just created, I get

warning: Invalid argument supplied for foreach() in /home/pwpa/public_html/modules/ecommerce/contrib/ec_roles/ec_roles.module on line 75.

If from the transactions list, I I click the "items" link for the new transaction, I get

* warning: Invalid argument supplied for foreach() in /home/pwpa/public_html/modules/ecommerce/contrib/ec_roles/ec_roles.module on line 75.
* warning: array_keys() [function.array-keys]: The first argument should be an array in /home/pwpa/public_html/modules/ecommerce/store/store.module on line 1873.
* warning: Invalid argument supplied for foreach() in /home/pwpa/public_html/modules/ecommerce/store/store.module on line 1873.

Comments

worldcoast’s picture

I have the exact same group of problems localized in Canada

Fatal error: Call to undefined function: product_unit_nice_name() in /home/tiffani/worldcoast_html/modules/ecommerce/store/store.module on line 898

sammys’s picture

Assigned: Unassigned » sammys
Status: Active » Postponed (maintainer needs more info)

Hi,

Thank you for submitting the bug report.

I've had a close look into the bugs you've listed and it appears the first bug prevents a record from appearing in the ec_transaction_product table thus causing the following error messages as they all reference the entry in that table.

The first bug is caused by legacy code remaining in the system and can be safely removed. Could you please confirm with me that the if block surrounding line 898 in store.module can be commented out and the site resumes full functionality?

/*
    if ($item->is_recurring) {
      if (!$item->expires) {
        $item->expires = strtotime($item->price_interval. ' '. product_unit_nice_name($item->price_unit, $item->price_interval), time());
      }
    }
*/

Should the subsequent errors still arise please give me information of what modules you have installed and product attributes required to reproduce the errors.

Kind regards,

Sammy Spets
Synerger
http://synerger.com

david blakesley’s picture

Status: Postponed (maintainer needs more info) » Fixed

Thanks, Sammy. This fix resolved the issue. We commented out those lines in store.module and the create transaction process worked like a charm. Nice work!

Dave

sammys’s picture

Fix has been committed to 4.7-3.x and 5.x-3.x and will be included in the next snapshot.

Anonymous’s picture

Status: Fixed » Closed (fixed)