I have never used it.

CommentFileSizeAuthor
#4 2112095-remove-unique_hash.patch5.63 KBlongwave

Comments

longwave’s picture

I don't think it is used any more. Maybe it should be removed, it might be useful to uniquely identify a product, but UUID module is probably better for this.

tr’s picture

Title: What is the use case of unique_hash column in uc_products table » Remove unique_hash column in uc_products table
Category: support » task

Yeah, that's a leftover from Drupal 5 / Ubercart 1, which used to have a built-in uc_importer module to do XML import/export of products. They needed a unique identifier for products that would work across different machines - nid is the primary key for the table but nids are machine-specific. You can read more about it if you're interested by searching ubercart.org: http://www.ubercart.org/search/node/unique_hash

Product import/export is best done these days through a general purpose module that can deal with all types of nodes, not just products. I'm not sure why unique_hash wasn't removed 5 years ago; we've been unknowingly carrying it around for years and it's no longer needed.

Changing this to a task ...

g089h515r806’s picture

I am writing a module "Ubercart product field" which leveraging field to store product info, I add unique_hash to field schema, but I get a error message on it. if it is useless, i will not support it. it works after i remove it from field schema.

longwave’s picture

Status: Active » Needs review
StatusFileSize
new5.63 KB

The attached patch removes this column and all code that refers to it. The only thing that still used it was uc_product_uc_product_class() which used it as a way of identifying rows in uc_products without any data when converting an existing content type into a product class. There is a simpler way to do this in SQL, and I added a test to confirm this still works.

longwave’s picture

Status: Needs review » Fixed

Committed #4.

Status: Fixed » Closed (fixed)

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