Zen Cart Logo
Forums / Bug Reports / [Done v1.3.6] bug with state selection check on registration

[Done v1.3.6] bug with state selection check on registration

Locked

Views: 20,395

Results 1 to 20 of 83
This thread is locked. New replies are disabled.
22 Sep 2006, 5:42 PM
#1
dbrewster avatar

dbrewster

Zen Follower

Join Date:
Jul 2005
Location:
Charlottesville, VA
Posts:
376
Plugin Contributions:
0

[Done v1.3.6] bug with state selection check on registration

Helloos.

Well, y'know, I used to do QA and product testing... for an early multiplayer online gaming company!

Getting to the point:

For a store with Configuration > Customer details >
State = True
State - Always display as pulldown = True

Procedure to reproduce:

  1. User creates an account but neglects to select state from the drop list before hitting Submit.
  2. Error informs user to select a state from drop list.
  3. User selects state, then hits Submit.
  4. Error popup says * Your state must contain a minimum of 2 characters.

"Fatal" condition ensues which can only be rectified by closing and reopening the browser window, and remember to choose state from drop list before hitting Submit.

I hope this helps! :smartass:

really not meaning to be a smartass... :lookaroun

---Diana

22 Sep 2006, 6:10 PM
#2
jeffd avatar

jeffd

Totally Zenned

Join Date:
Sep 2004
Posts:
605
Plugin Contributions:
1

Re: [Done v1.3.6] bug with state selection check on registration

Hahaha, I was just getting ready to report this one when I saw your bug report! :laugh:

I can confirm what you are seeing... :yes:

Jeff

22 Sep 2006, 6:34 PM
#3
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: [Done v1.3.6] bug with state selection check on registration

also try to NOT use the dropdown and try to create an account using PA for Pennsylvania or NE for Nebraska, it gets really fun

25 Sep 2006, 5:49 PM
#4
jeffd avatar

jeffd

Totally Zenned

Join Date:
Sep 2004
Posts:
605
Plugin Contributions:
1

Re: [Done v1.3.6] bug with state selection check on registration

Has anyone made any progress on a solution for this problem?

We had a number of customers send angry emails over the weekend as a result of the problem, so I am going to have to look into correcting ASAP and was hoping someone perhaps has already took a stab at a fix, even a partial one?

Thanks,
Jeff

25 Sep 2006, 9:40 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: [Done v1.3.6] bug with state selection check on registration

We hope to have the fix out for all countries and situations and configurations before too long ... sorry for the delay ... :cry:

25 Sep 2006, 10:10 PM
#6
jeffd avatar

jeffd

Totally Zenned

Join Date:
Sep 2004
Posts:
605
Plugin Contributions:
1

Re: [Done v1.3.6] bug with state selection check on registration

Thank you for the update Linda!

I may take a stab at it tomorrow if I get some free time... if so and I find a solution I will post it. :yes:

sinc,
Jeff

26 Sep 2006, 2:55 PM
#7
dbrewster avatar

dbrewster

Zen Follower

Join Date:
Jul 2005
Location:
Charlottesville, VA
Posts:
376
Plugin Contributions:
0

Re: [Done v1.3.6] bug with state selection check on registration

Until a fix is available:

includes/languages/[your custom template directory]/english.php (or your preferred language define)

define('ENTRY_STATE_ERROR', 'Your State must contain a minimum of ' . ENTRY_STATE_MIN_LENGTH . ' characters.\n\n
**If you cannot complete your edit or selection of your state, this is a software error. 
Please *close* your browser window, reopen, restart your registration and select state before hitting Submit.\n\n
We regret the error. Thank you for your patience.');

This at least will tell customers what is going wrong and what to do about it.

---Diana

29 Sep 2006, 7:11 PM
#8
moebiusenterprises avatar

moebiusenterprises

Zen Follower

Join Date:
May 2005
Location:
Phoenix Arizona (whew!)
Posts:
167
Plugin Contributions:
0

Re: [Done v1.3.6] bug with state selection check on registration

JeffD:

Has anyone made any progress on a solution for this problem?

We had a number of customers send angry emails over the weekend as a result of the problem, so I am going to have to look into correcting ASAP and was hoping someone perhaps has already took a stab at a fix, even a partial one?

Thanks,
Jeff

I'm getting the same cranky emails... will try the interim patch listed, but am hoping for a real fix soon. Any ideas when?

Vicki
https://www.moebiusenterprises.com

1 Oct 2006, 9:47 PM
#9
robert_saint_john avatar

robert_saint_john

New Zenner

Join Date:
Sep 2006
Posts:
3
Plugin Contributions:
0

Re: [Done v1.3.6] bug with state selection check on registration

Hi all, first post here. Just wanted to post a possible solution to the State Dropdown issue.

Background: Installed Zen Cart 1.3.2 (IIRC) using Fantastico on my host. Manually upgraded to 1.3.5 before proceeding with any customization. Built my custom look and feel, configured everything, entered all my stock, tested tested tested and all went fairly smoothly. Created three test accounts (local state, outside state, and overseas) to test shipping and payment and sales tax. Perfect, no problems. Went live Thursday midnight.

On Friday, decided that we had to have a "newsletter only" option. Found the "Newsletter Subscribe" module/contribution (NotGoddess 07/03/2006 certified for ZC v1.3.0) and decided to give it a shot to see if it would work with 1.3.5. Did my backups, integrated it, and all seemed fine.

This morning we got an e-mail from a customer who couldn't register/create account. Sure enough, I went to look, and we had a "state dropdown" issue. Not sure if it is THE state dropdown issue, but in short: test for "state" field was now gone, country dropdown wouldn't be accepted by regiustration process, enabling state dropdown box caused double fields, and I couldn't find a combination of settings to get things back.

Realized that the last major change I'd made was adding "Newsletter Subscribe". Looked at the files involved, and as part of the process I'd put a "create_account.php" in my tempate folder as an override. Turned this off and, voila, got everything back. But I had both a dropdown for statem, and a field for state underneath it. Tried creating an account, but it wanted text in that state field. Turned off the dropdown for state, and that fixed it. Changed minimum text value for state to "zero" to account for some internationals. Tested creating a number of different customer types, ran some test purchases and all is well.

Strangely enough, even though I turned off the "create_account.php" override that came with "Newsletter Subscribe", the feature still seems to work just fine.

Anyway, hope this helps someone, hadn't seen this solution elsewhere in the forum. It occurred to me that other longtimers may have used "Newsletter Subscribe" too, and run into the state dropdown problem, and never looked to it as a possible solution.

P.S. We LOVE ZenCart, and will be making a nice donation to the effort. I'm not only stunned that such a great app and community exists, but that it is so powerful, even for our simple little store.

Robert

Robert Saint John, San Francisco CA

5 Oct 2006, 7:53 PM
#10
jetx avatar

jetx

Zen Follower

Join Date:
Apr 2006
Posts:
425
Plugin Contributions:
0

Re: [Done v1.3.6] bug with state selection check on registration

Glad it works for you. I've tried a few things including the contrib but find it all a bit haphazard so have put 1.35 aside until this bug gets a proper fix as the previous version works well enough.

6 Oct 2006, 9:59 PM
#11
jeffd avatar

jeffd

Totally Zenned

Join Date:
Sep 2004
Posts:
605
Plugin Contributions:
1

Re: [Done v1.3.6] bug with state selection check on registration

Sorry to be so long getting back to this but company tasks outrank free work. :yes:

I got back to this a few minutes ago and found a possible solution, it seems to work here but your results may vary so I make no guarantees that it will fix the problems with other countrys etc., but it does seem to fix the dead end situation a user gets into if they initially forget to select a state during account creation.

Here is the change:

In the file includes/modules/pages/create_account/jscript_form_check.php

Locate the line which reads:

<?php if (ACCOUNT_STATE == 'true') echo '  if (!form.state.disabled && form.zone_id.value > 0) check_input("state", ' . ENTRY_STATE_MIN_LENGTH . ', "' . ENTRY_STATE_ERROR . '") . "\n";?>

and change it to read:

<?php if (ACCOUNT_STATE == 'true') echo '  if (!form.state.disabled && form.zone_id.value > 0) check_input("state", ' . ENTRY_STATE_MIN_LENGTH . ', "' . ENTRY_STATE_ERROR . '")  form.state.disabled="disabled";' . "\n";?>

Let me know if this works and if so how well?

Thanks,
Jeff

7 Oct 2006, 2:44 PM
#12
pixxi avatar

pixxi

Totally Zenned

Join Date:
Jan 2004
Location:
UK
Posts:
1,065
Plugin Contributions:
1

Re: [Done v1.3.6] bug with state selection check on registration

Thanks Jeff,

Just tried your fix on 1.3.5 (with states pulldown = false, and leaving the states field empty when clicking 'submit')

it does seem to overcome the problem of having to type the state into the second states box (which still shows after the error message) after selecting a state from the pull-down in order to create an account.

Part of the problem though, of course, is that the second state field does appear once the states pull-down is activated (either through 'states pull-down = true', or through a user error on create account).

Something which doesn't seem to have been mentioned so far (at least in the bugs forum) is that the problem also appears to extend to the address book (adding/editing an address) and to changing a billing/shipping address during checkout.

7 Oct 2006, 5:30 PM
#13
jeffd avatar

jeffd

Totally Zenned

Join Date:
Sep 2004
Posts:
605
Plugin Contributions:
1

Re: [Done v1.3.6] bug with state selection check on registration

Hi Pixxi,

We use the 'states pull-down = true' configuration so my fix was just to get that functionality to work correctly however your comment about how this is all supposed to work begs further explanation.

As I understand the new states "mechanism" design, the States/Province text field is always supposed to be visible regardless of the states pull-down configuration, at least it is for us. Based on the country selected and whether there are zones associated with the selected country, the zones (States/Province) popup menu's first and default choice is set to: "Please select..." indicating to the customer is to select a choice from the zones (States/Province) menu. If the default country in your configuration has zones associated the (States/Province) text field is disabled (but still visible) and will not permit text entry.

If a country is selected that has no zones associated with it, as in the case of 'Antartica', the the zones (States/Province) popup menu's default and only choice is set to: "Type a choice here..." and the States/Province text field is enabled and will permit text entry.

This all seems like the correct behavior to me at least and with the suggested change now works fine here in all cases when the default country is the 'United States' using the 'states pull-down = true' configuration. I am wondering though after your explanation if you are seeing a different behavior as we are? You might consider taking a look at our site create account functionality and commenting if your site behaves the same? I am interested if after adding this code change others using different states pull-down configuration and/or other default country can comment on their success/failure, and where problems still exist, if they do?

Thanks,
Jeff

7 Oct 2006, 6:52 PM
#14
pixxi avatar

pixxi

Totally Zenned

Join Date:
Jan 2004
Location:
UK
Posts:
1,065
Plugin Contributions:
1

Re: [Done v1.3.6] bug with state selection check on registration

Ahh ... I was assuming that the text edit box should only appear if no zones existed for the country selected - otherwise (my thinking was) it could be confusing for a customer having a text-entry box that they can't type into/doesn't have a label (and what's more, it spoils the symmetery of the page :smile: )

But looked at from that perspective, it does now seem to be working - so well done, and thanks :smile:

/ dashes off to see if that second box can be disabled until needed ... :sadwalk:

7 Oct 2006, 7:21 PM
#15
jeffd avatar

jeffd

Totally Zenned

Join Date:
Sep 2004
Posts:
605
Plugin Contributions:
1

Re: [Done v1.3.6] bug with state selection check on registration

Hi Pixxi,

I agree it should behave the way you describe. I really don't think it would be too hard to modify the code to hide the field when there exists zones for the selected country and show it when there are none. We are actually using some javascript code to do a very similar thing (hide or show form fields based on a popup menu form selection) on another site based on the work found here. It works perfectly under both FF and IE and I believe this methodology could easily be adapted to this situation. I'll probably take a stab it it on Monday when I return to work. :yes:

Thanks for your feedback!

Jeff

7 Oct 2006, 7:47 PM
#16
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: [Done v1.3.6] bug with state selection check on registration

The official bug-fix is in testing phase now. More to come ...

9 Oct 2006, 2:28 PM
#17
jeffd avatar

jeffd

Totally Zenned

Join Date:
Sep 2004
Posts:
605
Plugin Contributions:
1

Re: [Done v1.3.6] bug with state selection check on registration

That's great Dr. Byte, I will refrain from doing any further work for now then!

Is the official bug fix going to hide the state field when it is not required?

Thanks,
Jeff

9 Oct 2006, 4:37 PM
#18
jeffd avatar

jeffd

Totally Zenned

Join Date:
Sep 2004
Posts:
605
Plugin Contributions:
1

Re: [Done v1.3.6] bug with state selection check on registration

Pixxi,

Just an FYI... I typoed the fix line, it should have read:

<?php if (ACCOUNT_STATE == 'true') echo '  if (!form.state.disabled && form.zone_id.value > 0) check_input("state", ' . ENTRY_STATE_MIN_LENGTH . ', "' . ENTRY_STATE_ERROR . '");  form.state.disabled="disabled";' . "\n";?>

It was missing a ";" terminator otherwise the jscript has an error which causes it to fail. Sorry!
There are 6 places in the code that require the change.

Jeff

9 Oct 2006, 5:53 PM
#19
pixxi avatar

pixxi

Totally Zenned

Join Date:
Jan 2004
Location:
UK
Posts:
1,065
Plugin Contributions:
1

Re: [Done v1.3.6] bug with state selection check on registration

Thanks for the correction Jeff,

Although ...

There are 6 places in the code that require the change.

is a bit puzzling :smile:

9 Oct 2006, 6:18 PM
#20
jeffd avatar

jeffd

Totally Zenned

Join Date:
Sep 2004
Posts:
605
Plugin Contributions:
1

Re: [Done v1.3.6] bug with state selection check on registration

Hi Pixxi,

You should actually have only 5 places, assuming you added this fix to the following files that require it:

includes/modules/pages/address_book_process/jscript_main.php
includes/modules/pages/checkout_payment_address/jscript_main.php
includes/modules/pages/checkout_shipping_address/jscript_main.php
includes/modules/pages/create_account/jscript_form_check.php
includes/modules/pages/login/jscript_form_check.php

I have one additional (special) account creation form so I had six. :blush:

Jeff