[ic] Table access problem

Mike Heins mikeh@minivend.com
Thu, 14 Dec 2000 22:08:36 -0500


Quoting Jerry (jerry@digitalfm.com):
> Maybe someone a little more familiar with the
> IC internals could help here? Taking the inventory
> thing a bit farther with:
> 
> [calc tables="inventory" arg="carts"]
> 	my $item;
> 	foreach my $item ( @{$Safe{'carts'}->{'main'}} ) 
> 	 { 
> 	    my $in_stock = tag_data('inventory', 'quantity', $item->{code});
> 	    next if $in_instock >= $item->{quantity};
> 	    $item->{changed_it} = $item->{quantity};
> 	    $item->{quantity} = $in_stock;
> 	
> 	return;
> 	}
> [/calc]
> 
> Generates an error: 
> Safe: Can't locate object method "open_table" via package 
> "Vend::Table::DBI" at /d01/inter/lib/Vend/Data.pm line 872. 

This is docuemented. The table must be opened, and [calc] won't
do it.

You appear to be mixing MV3 and MV4 stuff.

 [perl tables="inventory"]
 [/perl]

You probably should refer to carts as $Carts->{main} or $Items. The Safe->
stuff is there for compatibility, but is not the normal method.

-- 
Akopia, Inc., 131 Willow Lane, Floor 2, Oxford, OH  45056
phone +1.513.523.7621 fax 7501 <heins@akopia.com>

Being against torture ought to be sort of a bipartisan thing.
-- Karl Lehenbauer