MiniVend Akopia Services

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

Bug when using va=var=value and st=sql ...



After being unable to use the va=var=value construct in manually formed
links this afternoon, I decided to check out the mailing list to see if
others had encountered any problems with this feature.  Turns out that a few
others have expressed difficulty getting this to work when using SQL
searches (st=sql) ... Looking into the source for lib/Vend/Scan.pm I think
I've found the problem.

Mike, perhaps you can take a quick look-see?

It appears that when a request comes in for /scan/whatever/etc.../
bin/minivend calls:

665: my $status = perform_search($c,$argument);

perform_search is a routine in lib/Vend/Scan.pm ... This is where the error
is, if you're doing a SQL search... It appears that the sql_search is being
performed and it's status code returned back to bin/minivend without
inspecting the other arguments given in the URL first!

lib/Vend/Scan.pm:

Lines 836-841
---------------------------------------------------------------------------
if (defined $more_matches and $more_matches) {
  return do_more($c, \%options, $more_matches, $delay );
}
 elsif (defined $c->{mv_searchtype} and $c->{mv_searchtype} eq 'sql') {
RETURN -->:  return sql_search($c, \%options, undef, $delay);
}
---------------------------------------------------------------------------

[snip]

Lines 864-872
---------------------------------------------------------------------------
foreach $param ( grep defined $c->{$_}, @Order) {
  $p = $Map{$param};
  $options{$p} = $c->{$param};
PARSE -->:  $options{$p} =
    &{$Parse{$p}}(\%options, $options{$p})
      if defined $Parse{$p};
  last if $options{$p} eq '-1' and $p eq 'mv_profile';
  delete $options{$p} unless defined $options{$p};
}
---------------------------------------------------------------------------

Those two lines I've marked, RETURN -->: and PARSE -->: are the ones I'm
refering to..

Notice that if we are doing a sql search, mv_searchtype eq 'sql' then we
return the status code back to bin/minivend before we hit the loop below
that actually calls the references to the routines handling options (setup
by %Parse)....

Mike, do you have a recommended fix for this or shall I proceed to patch 8-)
....

Thanks!

--
Warmest Regards...
__________________________________________________________________
Jeff Carnahan                                    CTO Networq, Inc.
http://www.networq.com/                      jcarnahan@networq.com
__________________________________________________________________




Search for: Match: Format: Sort by: