[ic] UI item delete

Mike Heins mike at perusion.com
Sun Mar 14 10:29:45 EST 2004


Quoting Chen Naor (chen at lilux.co.il):
> > Hi,
> > IC 5.0 + Pg 7.4.1
> > 
> > It seems that delete item delete then items from: products, pricing,
> > inventory, merchandising, options,
> > but if there is a matrix options using variants (variants table) it
> > is left undeleted. 
> > Is it a feature problem, configuration problem or a bug?
> 
> OK , I did some research.
> I addede to variable table the following:
> UI_ITEM_TABLES  products pricing inventory merchandising options:sku  variants:sku
> When deleteing a product I get the following error:
> 
> Deleted GAIL from products 
> Deleted GAIL from merchandising 
> deleted 2 records from options where sku = 'GAIL'
> db_maintenance: 
> No records in variants where sku = '''GAIL'''
> 
> 
> If I change the order of the tables in UI_ITEM_TABLES  the error is 
> 
> db_maintenance: 
> No records in options where sku = '''GAIL'''
> 
> Any ideas?

It's a bug. Try this patch to lib/UI/profiles/db_maintenance:

--- /DU/profiles/db_maintenance	2003-01-13 17:31:12.000000000 -0500
+++ /du/profiles/db_maintenance	2004-03-14 10:24:28.000000000 -0500
@@ -137,15 +137,15 @@
 				}
 				if($col) {
 					next unless length ($key);
-					$key = $db->quote($key, $col);
-					my $num = $db->query("delete from $t where $col = $key");
+					my $k = $db->quote($key, $col);
+					my $num = $db->query("delete from $t where $col = $k");
 					if($num > 0) {
 						push @out, errmsg(
 									"deleted %s records from %s where %s = %s",
 									$num,
 									$t,
 									$col,
-									$key,
+									$k,
 									);
 					}
 					else {
@@ -153,7 +153,7 @@
 										"No records in %s where %s = %s",
 										$t,
 										$col,
-										$key,
+										$k,
 										);
 					}
 				}

Thanks for the investigation.

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.765.647.1295  tollfree 800-949-1889 <mike at perusion.com>

The U.S. Senate -- white male millionaires working for YOU!  -- Dave Barry


More information about the interchange-users mailing list