Closed (fixed)
Project:
Ubercart Donation Products
Version:
6.x-2.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Feb 2009 at 21:01 UTC
Updated:
26 Mar 2009 at 22:50 UTC
Great module really cool!!
Ran into issue after installing the latest version as still getting the following error:
warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'uc_catalog_buy_it_now_form_41' was given in /siteroot/public_html/site/includes/form.inc on line 366.
Any ideas of suggestions?
Thank you,
Comments
Comment #1
tominglis commentedI have Drupal 6.9, with the following modules:
ACL / Content Access, Adsense, Captcha, Event / Signup, Image, Nice Menus, Profile Privacy, Tac Lite, Ubercart / Donation Products / VAT Number, Views, Weather
When I click on a catalog category containing a donation product I get a warning message at the top for each donation, and they have no 'Add to cart' button:
warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'uc_product_add_to_cart_form_365' was given in /home/standrew/public_html/includes/form.inc on line 366.
If I click on a donation, I can edit the amount and add it to the cart, but I get two instances of the following warning:
warning: Invalid argument supplied for foreach() in /home/standrew/public_html/sites/all/modules/ubercart/uc_donation/uc_donation.module on line 540.
warning: Invalid argument supplied for foreach() in /home/standrew/public_html/sites/all/modules/ubercart/uc_donation/uc_donation.module on line 540.
These also appear when viewing the Shopping cart:
warning: Invalid argument supplied for foreach() in /home/standrew/public_html/sites/all/modules/ubercart/uc_donation/uc_donation.module on line 540.
warning: Invalid argument supplied for foreach() in /home/standrew/public_html/sites/all/modules/ubercart/uc_donation/uc_donation.module on line 540.
If I try to remove it from the cart, it works, but I get one instance of the warning:
warning: Invalid argument supplied for foreach() in /home/standrew/public_html/sites/all/modules/ubercart/uc_donation/uc_donation.module on line 540.
Changing the amount in the cart adds an additional warning to those already there:
warning: Invalid argument supplied for foreach() in /home/standrew/public_html/sites/all/modules/ubercart/uc_donation/uc_donation.module on line 540.
I get the same two warnings on each page of checkout:
warning: Invalid argument supplied for foreach() in /home/standrew/public_html/sites/all/modules/ubercart/uc_donation/uc_donation.module on line 540.
warning: Invalid argument supplied for foreach() in /home/standrew/public_html/sites/all/modules/ubercart/uc_donation/uc_donation.module on line 540.
Comment #2
tominglis commentedIt is also not possible to now create a donation product that is assigned to a vocabulary term within the catalogue, nor to edit those products that were already configured in this way.
Comment #3
bunger commentedI am also seeing this same issue and it's a show stopper...
Comment #4
WebbyWorker commentedHere is the fix for part of the problem wiht uc_donations
Seem to work for us.
http://drupal.org/node/341819
--- uc_product/uc_product.module (saved version)
+++ (current document)
@@ -399,7 +399,7 @@
$products = db_query("SELECT DISTINCT nid, type FROM {node} WHERE nid = %d", $args[0]->nid);
while ($product = db_fetch_object($products)) {
- if (in_array($product->type, array_keys(uc_product_node_info()))) {
+ if (in_array($product->type, module_invoke_all('product_types'))) {
$forms['uc_product_add_to_cart_form_'. $product->nid] = array('callback' => 'uc_product_add_to_cart_form');
$forms['uc_catalog_buy_it_now_form_'. $product->nid] = array('callback' => 'uc_catalog_buy_it_now_form');
}
Comment #5
greenskin commentedThis should not be a problem anymore. A work around has been made and committed to today's dev release.