Hi. Thanks for this contribution!

After installing the module I get the following error message:

user warning: Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '=' query: SELECT * FROM uc_product_adjustments upa LEFT JOIN uc_product_stock ups ON ups.sku = upa.model WHERE upa.nid = 296 in /mysite.com/web/public/includes/database.mysql.inc on line 172.

The module is currently not checking stock for me.

Running Ubercart 1.3.

Any ideas?

Thanks!

Comments

oldmanpants’s picture

I didn't realize that this module depends on uc_multistock. The ajax script is now working.

But, I still get the error message recorded above.

Thanks!

hanoii’s picture

It does not depend on uc_multi_stock, or at least not in a way that I am aware of :s I am actually using both modules but I have just tried it disabling uc_multi_stock and it worked just fine as well. As you sure about this dependence?

As for the mysql issue, not an expert, but it looks as if the both tables used in the mysql query have different collations. Basically it's what the warning says. One is unicode, and one is utf8, and as I am joining the tables using a string column that should be rising the warning. You should check the collation of the tables using your mysql manager of preference and change all the tables, or at lest these two: (uc_product_adjustments, uc_product_stock) into a common collation (encoding). I would suggest using utf8 for most of them.

oldmanpants’s picture

Thanks for the reply.

I worked out the mysql issues. Thanks.

Regarding the dependence on uc_multistock, I assumed that from a post I read at ubercart.org...

Got it working now for products with attributes.

For products without attributes, and that are out of stock, the add to cart button is not changed to the 'out of stock' message, when a user visits the product specific pages (the only place I have add to cart buttons enabled).

Any ideas?

Thanks!

hanoii’s picture

Thanks for reporting this. I worked some more on the module and improved the logic in a way that should handles both products with and without attributes properly, please try it and let me know how it goes.

The new release is 5.x-1.0-beta2.

hanoii’s picture

Title: user warning: Illegal mix of collations » not working for products without attributes
oldmanpants’s picture

Beta 2 seems to be working great. Tested just now on products with and without attributes.

Thanks!

hanoii’s picture

Status: Active » Fixed

Great!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.