I received the following error installing module:

Key column 'nid_id' doesn't exist in table query: CREATE TABLE cfh_uc_product_keys ( `pkid` INT unsigned NOT NULL auto_increment, `pksid` INT unsigned NOT NULL, `uid` INT unsigned NOT NULL DEFAULT 0, `order_id` INT unsigned NOT NULL DEFAULT 0, `nid` INT unsigned NOT NULL DEFAULT 0, `product_key` TEXT NOT NULL, `activations` INT unsigned NOT NULL DEFAULT 0, `status` INT unsigned NOT NULL DEFAULT 0, PRIMARY KEY (pkid), INDEX pksid_idx (pksid), INDEX uid_idx (uid), INDEX order_idx (order_id), INDEX nid_idx (nid_id) ) /*!40100 DEFAULT CHARACTER SET UTF8 */

I think the last index should be fixed but but I'm not totally sure (nid instead of nid_id).

This leads to the following warning when trying to add create a new Product:
warning: Invalid argument supplied for foreach() in /Applications/MAMP/htdocs/drupal-6.14/sites/all/modules/uc_product_keys/uc_product_keys.module on line 641.

I don't know why it's complaining.

Comments

freatida’s picture

I get a similar warning when enabling module:

user warning: Key column 'nid_id' doesn't exist in table query: CREATE TABLE uc_product_keys ( `pkid` INT unsigned NOT NULL auto_increment, `pksid` INT unsigned NOT NULL, `uid` INT unsigned NOT NULL DEFAULT 0, `order_id` INT unsigned NOT NULL DEFAULT 0, `nid` INT unsigned NOT NULL DEFAULT 0, `product_key` TEXT NOT NULL, `activations` INT unsigned NOT NULL DEFAULT 0, `status` INT unsigned NOT NULL DEFAULT 0, PRIMARY KEY (pkid), INDEX pksid_idx (pksid), INDEX uid_idx (uid), INDEX order_idx (order_id), INDEX nid_idx (nid_id) ) /*!40100 DEFAULT CHARACTER SET UTF8 */ in /home/mysite/public_html/includes/database.inc on line 529.

gwink’s picture

Any thoughts on this? It doesn't allow for import of keys yet either.

freixas’s picture

Assigned: Unassigned » freixas

This was fixed in v1,2 of uc_product_keys.install, which was checked in on 12/09/2009. If you get the latest dev release, the fix should be there—along with a ton of other fixes.

I've had one person verify that key import works.

freixas’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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