Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I just installed and configured this module with a node & product. using drupal 7.9 and 7.2x dev.
I got this error
Recoverable fatal error: Argument 2 passed to db_query() must be an array, null given, called in /var/www/vhosts/blah/blah/blah/sites/all/modules/uc_node_checkout/uc_node_checkout.module on line 1139
I posted this a bit ago and am still receiving this error. Any help would be greatly appreciated.
EDIT: This seems to be an issue with 'Product Attributes' and 'UC Node Checkout'. Node checkout does not like trying to add products with attributes
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedUsing some variation of the Rules/Entity/Ubercart development versions has created this error. A blank site with supported modules works fine. I'm going to keep testing....
EDIT: I was wrong apparently...
I now get the error when trying to create a node, attached to a product with attributes.
Versions of modules I'm using:
Rules = 7.x-2.0
Entity = 7.x-1.0-rc1
Ubercart = 7.x-3.0-rc2
UC Node Checkout = 7.x-2.x-dev
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedThis line seems to be using Drupal 6's database structure
$result = db_query("SELECT * FROM {uc_cart_products} WHERE data LIKE '%%\"node_checkout_nid\";i:%d;%%'", $nid);
Like 1139 of uc_node_checkout.module
This is the line giving me troubles, as well. Wondering if it needs to be updated for D7
Comment #3
christelle41 CreditAttribution: christelle41 commentedI have a problem when I try to update from the the first unofficial D7 version (http://drupal.org/node/1172060). The update fails and the module fails to work when I create a node.
Comment #4
christelle41 CreditAttribution: christelle41 commentedI have the same error with the last dev version (december 5th)... I have nodes with attributes.
Comment #5
christelle41 CreditAttribution: christelle41 commentedSi I can confirm that it works with a product without attributes and not with ones.
Comment #6
christelle41 CreditAttribution: christelle41 commentedI've replaced the function uc_node_checkout_load_cart_item Line 1139 of uc_node_checkout.module with :
It was the version of this function in the first unofficial D7 version (http://drupal.org/node/1172060).
I don't know if it's really correct (from a syntax point of view) but it works even with products with attributes. If it can help...
Comment #7
kreutzer CreditAttribution: kreutzer commentedThe above modification certainly allows me to fill up the node form and select the corresponding attribute, but when the node is submitted and the product added to cart, the attribute pricing is not captured. Only the base product price is reflected in the cart.
Comment #8
snap4417 CreditAttribution: snap4417 commentedI had the same problem made the same code change in #6. re: #7 the attribute pricing is not captured. I have this issue as well. kreutzer, did you reach a resolution?
I'm a Java programmer and trying to wrestle my way through Php and the Drupal design to see if I can correct it.
Comment #9
kreutzer CreditAttribution: kreutzer commentedsnap4417, nope I did not resolve this. And since I'm not a programmer and on a tight schedule, I just shifted back to D6 as there were too many issues like this cropping up for me in D7.
Comment #10
thomas1977 CreditAttribution: thomas1977 commentedNot trying to sound impatient, but is this issue being looked into by the maintainers? Need this module for a D7 project.
Comment #11
TR CreditAttribution: TR commentedI just went through the code and fixed all the places that were still using Drupal 6 style DB calls.
Please test the current -dev version and let me know if this is still a problem.
Comment #12
vgulla CreditAttribution: vgulla commentedNo, it is still not working. getting the error when using products with attributes:
"Fatal error: Call to a member function fetch() on a non-object in /modules/uc_node_checkout/uc_node_checkout.module on line 1142"
Comment #13
stadulis66 CreditAttribution: stadulis66 commentedHas anybody gotten node checkout and attributes to work together? No matter what patch I apply, I continue to get the same errors. Help Please!
Comment #13.0
stadulis66 CreditAttribution: stadulis66 commentedError status update