[ic] Proposed Route patch

Josh Lavin jlavin at endpoint.com
Fri Dec 23 23:04:44 UTC 2016


Quoting Mike Heins (mike at heins.com):
> I'd have to look. This is a funny beast -- it is some of the first code in
> Interchange and indeed is brought from the very earliest vend.pl code in
> 1995. My worry is that there is a tri-sense for $status. True, false, and
> undef. Have you looked at how it is used in the "submit" action in
> Vend::Dispatch?

Well, in Vend::Dispatch, it is "$ok" (line 476):

    ($ok, $order_no, $result_hash) = route_order(
                        $::Values->{mv_order_route},
                        $Vend::Items
                        );
    return 1 unless $ok;

In Vend::Order, the route_order() sub returns:

    if($main->{supplant}) {
        return ($status, $::Values->{mv_order_number}, $main);
    }

So it is $status in Vend::Order, but $ok in Vend::Dispatch.

The problem in Vend::Dispatch is that if $ok isn't set, it won't finish
the order, at least to the customer's point of view.
 
Thanks,
Josh 

> On Fri, Dec 23, 2016 at 11:28 AM, Josh Lavin <jlavin at endpoint.com> wrote:
> 
> > It seems that the long-standing comment about the 'main' Route in
> > catalog.cfg is wrong:
> >
> >     ## This route emails the order to you unless email is set to "", and
> >     ## failsafe-logs the order report a couple of places
> >
> > If you follow those instructions, then you see an error:
> >
> >     > Empty order routing main_entry (and not explicitly empty).
> >     > Either attach or email are required in the route setting.
> >
> > Kevin's docs are correct in this area:
> > "Note that either attach, email or empty must be set for a route."
> > http://interchange.rtfm.info/icdocs/Order_routing.html#email
> >
> > If you blank out 'email', but also set either 'attach' or 'empty' to 1,
> > then customer orders never show a receipt page, nor clear the cart, yet
> > an order is accepted.
> >
> > I followed the rabbit, and this ocurrs as $status is returned by
> > route_order() and is necessary to show the receipt and clear the cart.
> > Yet, $status is only set if emails are sent.
> >
> > The following patch fixes it, and corrects the documentation:
> >
> > https://github.com/jdigory/interchange/commit/
> > 928a93b11c8862f38f201c0d1fdfb94d777cee69
> >
> > Does anyone know if setting $status to true when no emails are sent is a
> > problem? Routing is an odd beast, but this seems to work fine in my
> > tests.
> >
> > Thanks,
> > Josh
> > --
> > Josh Lavin
> > End Point Corporation
> >
> > _______________________________________________
> > interchange-users mailing list
> > interchange-users at icdevgroup.org
> > http://www.icdevgroup.org/mailman/listinfo/interchange-users
> >
> 
> 
> 
> -- 
> The problem with Internet quotations is that many of them
> are not genuine. -- Abraham Lincoln

> _______________________________________________
> interchange-users mailing list
> interchange-users at icdevgroup.org
> http://www.icdevgroup.org/mailman/listinfo/interchange-users


-- 
Josh Lavin
End Point Corporation



More information about the interchange-users mailing list