[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[mv] problems with cart storage in simple demo and a workaround
This is for minivend 4.04a and perl 5.6.0. I do not know if interchange
has a similar problem as I've not yet taken the plunge to upgrade the
stores (no one will pay me for it yet :) )
I found that taking the cart storage code on the ord/basket.html page
for the simple demo causes a problem if the user has a space in the cart
name they enter. If they enter "Weekly Shopping" or "This is my cart" in
that space they'll end up with an identical cart for each distinct word.
In other words, they end up with a Weekly cart and a Shopping cart. What
makes matters worse is that you can no longer delete them. The error
logs show a bad data selector with "field = ''". My guess is that the
routine is splitting on whitespace for some reason. Anyway, I wrote a
small chunk of javascript to prevent them from doing this.
<SCRIPT>
space=/ /;
function validate() {
if (space.test(cart_storage.c_nickname0.value)) {
alert('Please do not use spaces when naming your carts');
event.returnValue=false;
}
}
</SCRIPT>
and
<FORM NAME="cart_storage" ACTION="[process-target secure=1]" METHOD=POST
onsubmit="validate();">
This is obviously not the right way to do this (either a fix to the code
itself or a regex replacement of whitespace with underscores woudl be
better) but it does work. The reported error for a user entering "one
last test" is:
128.182.51.135 imvjapDd:128.182.51.135 - [12/April/2001:23:58:59 -0400]
wff2 /cgi-bin/wff2.cgi/process.html Bad data selector='code' field=''
key='test'
128.182.51.135 imvjapDd:128.182.51.135 - [12/April/2001:23:58:59 -0400]
wff2 /cgi-bin/wff2.cgi/process.html Bad data selector='code' field=''
key='last'
128.182.51.135 imvjapDd:128.182.51.135 - [12/April/2001:23:58:59 -0400]
wff2 /cgi-bin/wff2.cgi/process.html Bad data selector='code' field=''
key='one'
Chris Rapier
_______________________________________________
Minivend-users mailing list
Minivend-users@minivend.com
http://www.minivend.com/mailman/listinfo/minivend-users