NOT SOLVED! Re: [ic] User tag on CommonAdjust producing an error message

Barry Treahy, Jr. interchange-users@icdevgroup.org
Fri Aug 30 15:24:01 2002


Barry Treahy, Jr. wrote:

> Dan Browning wrote:
>
>> At 10:07 PM 8/29/2002 -0700, you wrote:
>>
>>> Dan Browning wrote:
>>>
>>>> At 06:25 PM 8/29/2002 -0700, you wrote:
>>>>
>>>>> Below is the current CommonAdjust and yet the error I'm receiving 
>>>>> that immediately follows makes no sense to me when considering 
>>>>> that the tag is working fine on the CommonAdjust.
>>>>>
>>>>> CommonAdjust "&$Tag->tier_pricing( $item->{code}, 
>>>>> $item->{quantity} )" ;:price
>>>>>
>>>>> w2k.mmaz.com IQf3PB7m:192.168.10.10 - [29/August/2002:20:25:26 
>>>>> -0400] mmb2c /cgi-bin/mmb2c/ATT-0290-03-SMA-02.html Safe: Can't 
>>>>> locate object method "query" via package "Vend::Table::GDBM" 
>>>>> (perhaps you forgot to load "Vend::Table::GDBM"?) at
>>>>> /ibin/interchange/lib/Vend/Interpolate.pm line 5235.
>>>>> >
>>>>> > $Tag->tier_pricing( $item->{code}, $item->{quantity} )
>>>>> >
>>>>>
>>>>> Though the page is working, it will pollute my error log with tons 
>>>>> of messages and I'd like to fix or stop that...  Any ideas?
>>>>>
>>>>> Barry
>>>>
>>>>
>>>>
>>>>
>>>> This may not be your problem, but any functions that you call that 
>>>> use the database (perhaps 'products' and 'options' in your case) 
>>>> require that you first specify the database ala:
>>>>
>>>> [perl tables="products options"]
>>>
>>>
>>>
>>> Good evening Dan.
>>>
>>> Thanks for writing.  In this case, the CommonAdjust is using a 
>>> usertag for the determination of the proper pricing, of which in 
>>> that usertag a call to query does occur.  Perhaps I'm dense, or that 
>>> it is just late, but I do not see how I can meld your recommendation 
>>> into that setup...
>>
>>
>>
>> Ah, yes; that'll teach me to actually read the e-mail next time.  
>> :-)  Try a different usertag that does absolutely nothing and see if 
>> it still logs the error.  If it doesn't, then you could proceed to 
>> find which part of your usertag is triggering the error.
>
>
> I sub'd the tier_pricing tag with a iclog tag that basically writes 
> all of the passed parameters to a log file and the log file captured 
> the details and no errors were recorded in the catalog error.log.
>
> I proceeded to take the original tier_pricing tag and commented out 
> the actual query call which was in fact the problem.  Thank God for 
> the mailing archives, I found a code snippet by Kevin Walsh that 
> utilized the db->query version of the DB access which appears to work 
> just find and no errors...
>
> Can someone that is more IC/Perl savvy explain why the $Tag->query 
> would not work but the $db->query would?
>

I give, UNCLE!!!

w2k.mmaz.com MxyBptP2:192.168.10.10 - [30/August/2002:15:17:14 -0400] 
mmb2c /cgi-bin/mmb2c/TRM-2194-05-EMI-02.html Safe: Can't locate object 
method "open_table" via package "Vend::Table::GDBM" (perhaps you forgot 
to load "Vend::Table::GDBM"
?) at /ibin/interchange/lib/Vend/Data.pm line 910.
 >
 > $Tag->tier_pricing( $item->{code}, $item->{quantity} )
 >

After testing with the change, I started working on other parts of the 
system and when reviewing the log for another reason, I saw this!  It 
return, though it appears to be complaining about a different routine. 
 In a nutshell, this is what is in the usertag:

  my $sql = "select quantity,discount from tiers where tier='" . $tier 
."' order by code desc";
  my $db = ::database_exists_ref('tiers') or die 'Missing tiers table';
  my $results = $db->query({sql => $sql});

What kills me is that the code works, so why is IC complaining about it?

Barry

-- 

Barry Treahy, Jr  *  Midwest Microwave  *  Vice President & CIO 

E-mail: Treahy@mmaz.com * Phone: 480/314-1320 * FAX: 480/661-7028