Lots of MySQL errors when adding a product kit to the cart

Posts: 19
Joined: 04/08/2008

Whenever I add a product-kit to the cart I get the following bunch of errors:

  • warning: Invalid argument supplied for foreach() in /drupal/modules/node/node.module on line 521.
  • warning: implode() [function.implode]: Invalid arguments passed in /drupal/modules/node/node.module on line 525.
  • user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
    query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE in /drupal/includes/database.mysqli.inc on line 151.
  • warning: Invalid argument supplied for foreach() in /drupal/modules/node/node.module on line 521.
  • warning: implode() [function.implode]: Invalid arguments passed in /drupal/modules/node/node.module on line 525.
  • user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
    query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE in /drupal/includes/database.mysqli.inc on line 151.

In any case, the product kit is actually added to the cart…

There is one excetion though: when I click "add to cart" from the product kit page, the warnings are not displayed. The warnings show up when clicking the buttons in the catalog or any other listings.

I have already tried to delete the product kit and recreate it, to no avail.

Any ideas??

Gabriele

================

This is my conf:

Web Server: Apache/2.2.8 (Debian) DAV/2 PHP/5.2.5-3 with Suhosin-Patch mod_ssl/2.2.8 OpenSSL/0.9.8g mod_perl/2.0.3 Perl/v5.8.8

MySQL version 5.0.51a

Drupal 5.7

Ubercart version 1.0rc2

Posts: 822
Joined: 11/05/2007
Bug FinderFAQ ModeratorGetting busy with the Ubercode.

Very interesting. I tested this and I also get those same errors. And only when adding the Product Kit from the Catalog - works fine from the Product page, like you said. Interesting also because this is the same error I was seeing when I tried to get my Reorder Button contribution (http://www.ubercart.org/contrib/3734) working for Product Kits. (Reorder button will add everything from a previous order into your current cart.)

It appears that there is some missing information or some missing step that is needed for Product Kits that is only done on the product page, not on the cart page and not with my Reorder button either. I wonder what it is...

--

<tr>.

Posts: 19
Joined: 04/08/2008

Mmh... Is there anybody willing to help? With all those errors I can't use product kits on my shop...

Sad

Posts: 822
Joined: 11/05/2007
Bug FinderFAQ ModeratorGetting busy with the Ubercode.

You only raised the issue on Friday morning. It's still the weekend. The developers work normal hours. Be patient.

--

<tr>.

Posts: 2008
Joined: 08/07/2007
AdministratoreLiTe!

Found the problem in the way that form was being used. Products and product kits do some different things when they're added to the cart, so you can't use the exact same form in the catalog. Revision 1052 has the fix.

Posts: 19
Joined: 04/08/2008

Sorry for the ignorance: Where can I find "Revision 1052"?
Is it "http://bazaar.ubercart.org/drupal5/ubercart-bzr.tar.gz"?

Posts: 2008
Joined: 08/07/2007
AdministratoreLiTe!

That'll actually be the latest revision, so it's got a few more changes than just that. Use that and you'll be fine. The revision numbers are only useful for people using the Bazaar program to get the code.

Posts: 2
Joined: 06/11/2008

Hello,

I just wanted to let you know i'm still seeing this error, even after having the changes from revision 1052. ($cond is null. Perhaps for a different reason?) The functionality doesn't seem to be affected, however, (at least with the modules i'm using) so i just only added a WHERE clause when $cond was not null. Anyway, let me know if you can't reproduce this, or if you have a more all-encompassing fix. Thanks!

Posts: 2008
Joined: 08/07/2007
AdministratoreLiTe!

I'm not sure what you're talking about actually. I can't find $cond in Ubercart anywhere.