Active
Project:
UC Node Checkout
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Jan 2012 at 06:11 UTC
Updated:
3 Oct 2013 at 03:12 UTC
There's a bug report on the ubercart.org forums: http://www.ubercart.org/forum/bug_reports/30467/anonymous_users_cant_acc...
currently, in uc_node_checkout_module function uc_node_checkout_load_cart_item($nid) {}:
$result = db_query("SELECT * FROM {uc_cart_products} WHERE data LIKE '%%\"node_checkout_nid\";i:%d;%%'", $nid);
..this has not been updated for Drupal 7(the place holders are now done using the same syntax as PDOs (:nid)):
like this..?:
$result = db_query("SELECT * FROM {uc_cart_products} WHERE data LIKE '%%\"node_checkout_nid\";i::nid;%%'", array(':uid' => $nid));
Comments
Comment #1
tr commentedThat was just updated for Drupal 7 a few hours ago, coincidentally. Please download the new -dev and try again.
http://drupalcode.org/project/uc_node_checkout.git/commitdiff/8efcab2
Comment #2
danlanglois commentedhttp://drupalcode.org/project/uc_node_checkout.git/commitdiff/8efcab2
the line that is in question for me, is still there, line 1139:
$result = db_query("SELECT * FROM {uc_cart_products} WHERE data LIKE '%%\"node_checkout_nid\";i:%d;%%'", $nid);
'Argument 2 passed to db_query() must be an array, string given, called in C:\Users\Studio\Documents\My Web Sites\drupal-7.10\sites\all\modules\uc_node_checkout\uc_node_checkout.module on line 1139'
Comment #3
danlanglois commentedComment #4
tr commentedI cited the wrong commit above. That line was indeed fixed already - did you download the new -dev release and check?
Comment #5
LarsKaae commentedHI,
tried the above update, but then get this message:
Fatal error: Call to a member function fetch() on a non-object in C:\Users\Studio\Documents\My Web Sites\drupal-7.10\sites\all\modules\uc_node_checkout\uc_node_checkout.module on line 1142
I'm still trying to get anonymous user to see my products.... all other works.
it's great job here!
Comment #6
danlanglois commentedYes, I downloaded the new dev release and checked.
To be clear, that means I downloaded the 1-27 dev release, of course that's today.
Also, should this issue ever have been closed (duplicate), w/out citing the duplicate--stipulating that there is one? (and closed again. as a duplicate.).
And as to its now being a status: 'closed (won't fix)' that is assigned to LarsKaae, I think that's an error, I'm unnassigning, but reopening as 'needs work'.
I'm beginning to wonder if I'm contributing to the problem (tends to be the case)?
Comment #7
danlanglois commentedNote, the tar has been updated. There is a discrepancy between the tar and the zip file linked (ftp) on the project page.
http://ftp.drupal.org/files/projects/uc_node_checkout-7.x-2.x-dev.zip
This one only, is updated.
http://ftp.drupal.org/files/projects/uc_node_checkout-7.x-2.x-dev.tar.gz
Comment #8
danlanglois commentedThis is what is there:
as there is no member function fetch() on $result, I think it want to be simply this:
if ($item = $result) {..}
Comment #9
danlanglois commentedbtw syntax like this, assignment inside a condition, is not for the fainthearted..
Comment #10
LarsKaae commentedi'm a newbie, sorry
Still have the above bug after updating the 1 27 dev .tar file
Comment #11
LarsKaae commentedIt's seems to working now.... :-)
I can see the products as anonymous user and as aut.user.
I've just setting the right settings in node-checkout/settings:
I've unchecked these settings:
Redirect customers to their cart when they try to view a node governed by node checkout.
Users who have "edit node_type content" permission are exempt from this redirect.
Sorry for the convenience - it's a grat job you all doing.
Thanks!
Comment #12
summerg commentedI am having the same problem and checked the function uc_node_checkout_load_cart_item to confirm I had the most recent copy. All is good, but same error. I noticed $nid is null when it gets to that point... Still looking around.
Comment #13
gregaltuna commentedSame problem. Error states:
Fatal error: Call to a member function fetch() on a non-object in /home/content/31/9447231/html/clients/saleo/sites/all/modules/uc_node_checkout/uc_node_checkout.module on line 1142Node ID is not null in the URL. Have unchecked the suggested setting, and others, and still the error. Any updates? Anyone else still experiencing this problem? I have all the most recent updates installed.
Comment #14
glennnz commented+1
Both the latest dev version and the one referenced in #7 have this error.
Comment #15
sreekanth1201 commentedYa, even i got the same error...I used the above referenced verson ut even havng the same error..
Comment #16
stadulis66 commentedHas anybody figured this out yet. Node checkout and attribute module are conflicting and I can't figure it out.
Comment #17
klausson commentedI'm getting the same fatal error claiming a fetch on a non-object. Upon inserting some debug lines, I found that the problem is likely caused by an empty nid being passed to the function from this line (417) within _form_alter:
if ($item = uc_node_checkout_load_cart_item($form['nid']['#value'])) {
The nid being empty is not that surprising since I use node checkout for to create an order in conjunction with node/add. However, I've been doing the exact same thing in D6 and it worked fine. I also compared the code and it doesn't look like it has changed. So whatever trips it up seems to be due to changes in Ubercart or Drupal.
Comment #18
klausson commentedOne more note: IMHO, the priority should not be "normal", it should at least be major, if not critical since the resulting behavior makes the module unusable.
Comment #19
seanenroute commentedTry going to /admin/store/settings/node-checkout/settings and unchecking "Redirect customers to their cart when they try to view a node governed by node checkout."