MiniVend Akopia Services

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

MV:3.12 UserDB.pm fix



******    message to minivend-users from "Russ" <russ@khouse.org>     ******

If you don't add this to line 1135 of UserDB.pm you'll have problems with
adding a cart.  The problem happens if you put in spaces for the cart name.
This line strips out spaces to make the cart name non-problematic.
$s =~ s/\s//g;

The Whole set_cart function:

sub set_cart {
        my($self, %options) = @_;

        my $from;
        my $to   = $self->{NICKNAME};
        if ($self->{OPTIONS}{source}) {
                $from = $Vend::Session->{carts}->{$self->{OPTIONS}{source}}
||
[];
        }
        else {
                $from = $Vend::Items;
        }

        my $field_name = $self->{LOCATION}->{CARTS};
        my ($cart,$s,$d);

        eval {
                die "no to cart name?\n"
 unless $to;
                die "$field_name field not present to save $from\n"

 unless $self->{PRESENT}->{$field_name};

                $d = $ready->reval( $self->{DB}->field( $self->{USERNAME},
$fie
ld_name) );

                $d = {} unless $d;

                die "eval failed?"                              unless ref
$d;

                if($options{merge}) {
                        $d->{$to} = [] unless ref $d->{$to};
                        push(@{$d->{$to}}, @{$from});
                }
                else {
                }

                $d->{$to} = $from;

                $s = uneval $d;

        };

        if($@) {
                $self->{ERROR} = $@;
                return undef;
        }

$s =~ s/\s//g;
        $self->{DB}->set_field( $self->{USERNAME}, $field_name, $s);

}

Russ
--------------------------
Earn Money to surf the Internet Click Here!
http://www.alladvantage.com/refhome.asp?refid=AWW-495

-
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: