11 replies [Last post]
hanoii's picture
Offline
Joined: 07/30/2008
Juice: 103
Was this information Helpful?

I am experiencing this strange behavior:

Let say you fill in the shipping and billing address and then click the submit button with no CC info filled, you'll get a bunch of errors about CC info not being enetered but I also loss all the other filled fields on the checkout page. Even if I fill all the CC info but with an expired date so it would trigger the error, I also loss everything (including CC data).

The strangest is that if I run that locally (on my dev computer, same files, same database) I do get all the info in the fields after the error. For the credit card data I think I also have that stored as well, why that might be?

I really need help on this, I'll still be looking to see if I can find the solution or cause for this.

Thanks,
a.=

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Strange loss of checkout filled fields on error (only on my

Could it be related to the use of HTTPS on the production site? If a cookie is being lost that could cause you to lose form data. Really, though, in a normal working 1.6 install this isn't an issue.

hanoii's picture
Offline
Joined: 07/30/2008
Juice: 103
Re: Re: Strange loss of checkout filled fields on error (only on

It could be related to that, although not sure to know the difference as I am testing locally with HTTPS as well. I am using ubercart 1.5. I wasn't sure to upgrade becuase it's a live working site and the 1.5 seems to work fine in my local machine but not on the production site.

I might try to upgrade to see if that fixed the issue...

Thanks, and any more help would me much appreciated..

a.=

hanoii's picture
Offline
Joined: 07/30/2008
Juice: 103
Re: Strange loss of checkout filled fields on error (only on my

I tested it with 1.6 in the live site an it's happening the same as well, in case you this helps, you can try it out live at:

http://www.nubie.co.uk/ (reverted back to 1.5)

By choosing any product, going to checkout, filling in both billing and shipping entry with demo data and clicking on purchase (with no cc data info). You'll see that you get the error but everything else clears.

Thanks,
a.=

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Strange loss of checkout filled fields on error (only on

Can you duplicate the trouble on the Livetest?

(Nice site, btw!)

hanoii's picture
Offline
Joined: 07/30/2008
Juice: 103
Re: Re: Re: Strange loss of checkout filled fields on error (onl

No, Livetest is working just fine (as on my local machine).

I am starting to thing it might something to do with PHP version/config setup :s... very strange and hard to reproduce...

hanoii's picture
Offline
Joined: 07/30/2008
Juice: 103
Adding more info... Trying

Adding more info...

Trying it out without HTTPS (Secure Pages disabled) it does the same thing, clears everything on error.

Thanks Ryan Smiling I'll try it out now...

hanoii's picture
Offline
Joined: 07/30/2008
Juice: 103
Re: Strange loss of checkout filled fields on error (only on my

Any help debugging this problem?

I did something else with a different result:

I installed on the same server a brand new install of drupal + ubercart 1.6. No secure pages module installed although there's a dummy certificate to test HTTPS. On this setup, I experience the same problem only when browsing it via HTTPS, not if I browse it with HTTP.

However, this does not happen on my real site (nubie.co.uk), where the form data is cleared both with HTTP and HTTPS (with or without secure pages enabled).

I am a bit lost of what to follow, and if there's something I should look at the code or somewhere else. Any magic PHP setting or apache config I am missing?

I will post more findings if any.

Thanks,
a.=

TR
TR's picture
Offline
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3424
Re: Re: Strange loss of checkout filled fields on error (only on

Your site works fine for me in Firefox - the form data doesn't get cleared.

<tr>.
tekad's picture
Offline
Joined: 10/21/2008
Juice: 160
Re: Re: Re: Strange loss of checkout filled fields on error (onl

Fields are clearing for me in Opera, Camino and Firefox 3 on my Mac OS X 10.4.

Interesting though, if you leave one or more fields incorrect in the address sections, then all the field data persists. Also, if you just enter an email address only, the email address persists no matter how often you submit.

I have tried random data and also tried two London addresses. Valid address does not seem to be the issue here.

Also, any credit card info you enter does persist, so if the user enters everything besides the CVV, then email, billing and shipping are all returned blank, but the credit card info is repopulated into the form.

hanoii's picture
Offline
Joined: 07/30/2008
Juice: 103
Re: Re: Re: Strange loss of checkout filled fields on error (onl

You need to get no error on the shipping or billing address for those to be cleared on an error on any of the other fields (probably an issue of different panes)

felixbachman's picture
Offline
Joined: 03/24/2011
Juice: 3
Possible solution

I know this is an old thread, but since I stumbled over this problem with the latest version of ubercart (2.4) I thought I will let others know.
The issue here is that the credit card module (uc_credit) discovers an error (wrong credit card number) but does not set the checkout form to error.
Because of this the drupal system re-displays the form as if it would have been the first time and therefore the entered values are gone. (your browser might have stored those values and entered them again automatically. In this case you won't see the effect of this issue).
This can be fixed in the module uc_credit.module by replacing the call "drupal_set_message" in line 457, 466, 474, 482, 491, 499, and 507 with a call to "form_set_error('panes[', 'some error message');
There is even an easier way to make a change in the file "uc_cart.pages.inc" line 322. Enter a form_set_error here.
Hope this helps someone