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.
So i created an issue about a fatal error when using node checkout on views, im trying to assign multiple products to a node type the views option didnt work so i tried to use the ubercart attributes feature to define the different membership levels for one membership product. But when using attributes and node checkout instead of being directed to the page to create the node i get another white screen fatal error
Fatal error: Call to a member function fetch() on a non-object in ../../sites/all/modules/uc_node_checkout/uc_node_checkout.module on line 1142
Comments
Comment #1
vgulla CreditAttribution: vgulla commentedI am interested in this one too. Please help
Comment #2
sreekanth1201 CreditAttribution: sreekanth1201 commentedEven am geting the same error.suggestions on this really helpfull
Comment #3
HappyPanda CreditAttribution: HappyPanda commentedSame error here, a shame as otherwise the module seems to be a great fit for my clients needs.
Changing line 1142 to:
if ($item = $result) {
Seems to work, but the linkage between the product in the shopping cart and the created node seems to be flakey and the added product to the cart loses attributes.
Hoping one of the devs or someone with better Drupal foo than me can comment. I'm assuming this is just a bug bought about by recent version changes to drupal core, or the required modules (uber cart etc.)
Comment #4
vgulla CreditAttribution: vgulla commentedSome progress I guess. When I update the function at 1142 with this: (as mentioned in http://drupal.org/node/1342544#comment-5348736 )
function uc_node_checkout_load_cart_item($nid) {
static $items = array();
// If the item hasn't been searched before...
if (!isset($items[$nid])) {
// Load the data from the database.
$query = db_query("SELECT * FROM {uc_cart_products} WHERE data LIKE :like", array(':like' => '%' . db_like('"node_checkout_nid";i:' . $nid . ';') . '%'));
// If a matching product was found in the DB for this node...
if ($item = $query->fetchObject()) {
$item->data = unserialize($item->data);
$items[$nid] = $item;
}
else {
$items[$nid] = FALSE;
}
}
return $items[$nid];
}
I don't get the error and see the checkbox for the product attribute, but even when selected the price is not getting changed (i Set it to increment by 200). I am not sure what is missing here.
Hope this gives some clue for further fixing