Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: [mv] MV4 Chained Shipping w/ usertag - Follow up



******    message to minivend-users from Randy Moore <ramoore@axion-it.net>     ******

At 6/17/00 09:54 PM , you wrote:

>******    message to minivend-users from Randy Moore 
><ramoore@axion-it.net>     ******
>
>
>>Absolutely correct. Thanks for the fix!
>>
>>On your other question WRT chained shipping, I think your modes have
>>to be redirected with >> and not >.
>
>Unfortunately, not.  I tried that and some other variations.
>
>I get the same infinite loop behavior even with a trivial UserTag that 
>doesn't do any redirection.
>
>For example:
>
>UserTag do_ups Order mode adder zip weight
>UserTag do_ups Routine <<EOR
>sub {
>my ($mode, $adder, $zip, $weight) = @_;
>my $cost =1;
>return $cost;
>}
>EOR
>
>I'll keep poking through the Interpolate shipping routine to see if I can 
>figure out what is happening.  Is their anyplace else I should look?

Mike,

I've traced the looping problem to the following bit of code in Data.pm (in 
the chain_cost subroutine):

#       if($raw =~ /^\[\B/ and $raw =~ /\]$/) {
         if($raw =~ /^\[/ and $raw =~ /\]$/) {
                 my $ref = Vend::Interpolate::tag_calc($raw);
                 @p = @{$ref} if ref $ref;
         }

I don't think that the regex /^\[\B/ can ever match anything, so I've taken 
out the \B.  That fixed the endless looping.

But, now we pass a string like "[do_ups weight=18 mode=Ground adder=0]" to 
tag_calc, which completely chokes on it.

It products an error in the log file like:
host2.axion-it.com acNCVX3N:axion-it.com - [17/June/2000:22:31:19 -0400] 
cac /cgi/cac/process.html Safe:
  syntax error at (eval 177) line 1, near "18 mode"
 >
 > [do_ups weight=18 mode=Ground adder=0]

I'd have to guess that Vend::Interpolate::tag_calc is not the right routine 
to parse and interpolate this kind of string (or even a more complicated 
one like "[do_ups zip=[value zip] weight=18 mode=Ground adder=0]" which is 
what I started with).

The routine "interpolate_html" might be appropriate, but I don't know if it 
returns the correct data structures or what else might break with this kind 
of a change.  At this point, I'm way out of my depth.

Any suggestions?

Thanks.

Randy Moore
Axion Information Technologies, Inc.

email     ramoore@axion-it.net
phone   301-408-1200
fax        301-445-3947
-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: