Forums / Bug Reports / [Done v1.3.7] account creation bug when displaying create-account-success page

[Done v1.3.7] account creation bug when displaying create-account-success page

Locked

Started by unn on 6 Nov 2006, 10:45 PM · Views: 20,079

Results 1 to 20 of 60
This thread is locked. New replies are disabled.
6 Nov 2006, 10:45 PM
#1
unn avatar

unn

New Zenner

Join Date:
Nov 2006
Posts:
11
Plugin Contributions:
0

[Done v1.3.7] account creation bug when displaying create-account-success page

Earlier today I installed zencart on my server. I used wget unzip changed the ownership and group on the files to be used by my apache user. Install went smoothly. I go to create a test user and I get the following error.

[B]Warning[/B]:  Invalid argument supplied for foreach() in [B]/home/httpd/vhosts/eastmedent.com/httpdocs/store/includes/templates/template_default/templates/tpl_create_account_success_default.php[/B] on line [B]26[/B]
```I did a little research on the forums, thinking that this was a common problem, oddly I found that it only happened when upgrading or using a mod by NotGoddess.  Both of which I haven't done, as this is a default install, completely fresh.  

A little about my server:
Apache on Red Hat
PHP 4.3.2
MYSQL 3.23.58 

I gave it a shot at debugging what's going on and I'm feeling it has to do with line 41 of the the create_account_success header_php.php.  But today is one of those days where I just can't think.  
```php
  $addressArray[] = array('firstname'=>$addresses->fields['firstname'],
                          'lastname'=>$addresses->fields['lastname'],
                          'address_book_id'=>$addresses->fields['address_book_id'],
                          'format_id'=>$format_id,
                          'address'=>$addresses->fields);

Any help would be greatly appreciated.

Thanks,
David

6 Nov 2006, 11:25 PM
#2
drbyte avatar

drbyte

Sensei

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

Re: [Done v1.3.7] account creation bug when displaying create-account-success page

I can't reproduce the problem unless I delete code from the files, making the array unavailable.

in the header_php.php file, as you mentioned, line 41 produces the array:

  $addressArray[] = array('firstname'=>$addresses->fields['firstname'],
                          'lastname'=>$addresses->fields['lastname'],
                          'address_book_id'=>$addresses->fields['address_book_id'],
                          'format_id'=>$format_id,
                          'address'=>$addresses->fields);

Then line 26 of the template produces the output by looping through the array:```
foreach ($addressArray as $addresses) {


If the header_php.php file is missing code, then I could see this happening.

I suppose if you failed to actually save a valid address, then the error would appear too, since that array isn't initialized outside of the loop that produces the address data for output.

To initialize the array and suppress the error, you could add this on line 37 of the header_php.php file:```
$addressArray = array();
```, right above this line:```
while (!$addresses->EOF) {
```Thus, if you have some sort of database problem preventing the address from being saved, or a sessions problem preventing the customer's session id from being retained, then you'll see no address displayed, but also no error.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

7 Nov 2006, 3:34 PM
#3
unn avatar

unn

New Zenner

Join Date:
Nov 2006
Posts:
11
Plugin Contributions:
0

Re: [Done v1.3.7] account creation bug when displaying create-account-success page

Thanks for your quick reply. The thing is I didn't delete anything from any files as it was a completely fresh install. I have two instances of zencart on my server for two different clients and its the first time this happened. As for saving a valid address I am using my actual address, not some made up one.

But after initializing the array like you said the create_account_sucesss page seems to work fine.

I can't imagine that this is a database issue because even before when the error was occuring my info was being inserted correctly, though I couldn't log in.

Even though you provided a work around, DrByte, if you're interested in looking into this problem further, I'd be more then happy to provide any information you need.

7 Nov 2006, 3:39 PM
#4
drbyte avatar

drbyte

Sensei

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

Re: [Done v1.3.7] account creation bug when displaying create-account-success page

I'm puzzled as to why there would be no data returned, and thus trigger the error you mentioned ... as long as you're not importing customer records.

Can you reproduce the error on-demand if the fix above is not applied? Can it be produced repeatedly? If so, please post your server (ie: PHPinfo output) and browser specs.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

7 Nov 2006, 4:17 PM
#5
unn avatar

unn

New Zenner

Join Date:
Nov 2006
Posts:
11
Plugin Contributions:
0

Re: [Done v1.3.7] account creation bug when displaying create-account-success page

On my powerbook, yeah I can always produce the error in Firefox 2. Using Safari on my coworkers computer it seemed works fine, with the fix off. See php info here.

7 Nov 2006, 9:01 PM
#6
jetx avatar

jetx

Zen Follower

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

Re: [Done v1.3.7] account creation bug when displaying create-account-success page

Your two client sites wouldn't be sharing the same database would they?

8 Nov 2006, 1:07 AM
#7
twirlerzmom avatar

twirlerzmom

New Zenner

Join Date:
Nov 2005
Posts:
60
Plugin Contributions:
0

Re: [Done v1.3.7] account creation bug when displaying create-account-success page

I'd like to jump in on this one.......same thing just happened to me. I did a fresh install, new database, everything. Everything was working fine (much smoother than the site I just got done upgrading) but when I went to create a new account I got that same error mentioned above. Also, my page displays funny. The text runs way off to the right side of the page, with the continue button almost off the cart page entirely. All my other pages are fine. I did reload the original file just in case it had become corrupt or something but the error continued. Also reloaded the file that is working now in my live store to see if that helped but the error continues as well. I'm open to any solutions as well. If you would like to test my page go here:
http://www.astudiojdesign.com/new_store/index.php?main_page=login

8 Nov 2006, 1:33 AM
#8
drbyte avatar

drbyte

Sensei

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

Re: [Done v1.3.7] account creation bug when displaying create-account-success page

Did you apply the fix I mentioned earlier?
http://www.zen-cart.com/forum/showthread.php?p=288487#post287867

(Sorry, that's a rhetorical question, since I can see the error on your site if I force the main_page setting. Please apply the fix and then advise if there's still a problem.)

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

8 Nov 2006, 1:52 AM
#9
twirlerzmom avatar

twirlerzmom

New Zenner

Join Date:
Nov 2005
Posts:
60
Plugin Contributions:
0

Re: [Done v1.3.7] account creation bug when displaying create-account-success page

Yes, that helped with the error and formatting problem except it's still not working right. Everything appears to look correct but I have a box under my "success" congratulations message and in the box it says "primary address" in blue but nothing else. I clicked the continue button but it takes me back to the home page. I should mention that I received the email confirmation stating I have successfully created my account. I refreshed my page and tried logging in again but all that happens is the create account page keeps repeating itself. I never am able to log in or check out.

8 Nov 2006, 1:57 AM
#10
drbyte avatar

drbyte

Sensei

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

Re: [Done v1.3.7] account creation bug when displaying create-account-success page

You're saying that:

  1. this is a fresh v1.3.6 install with NO addons ?
  2. switching to "classic" template has the same effect?
  3. you can create an account, but always get the indicated error?
  4. you can see the account in the admin?
  5. the address info as seen in the admin is correct?
  6. you cannot log in using this account ?
  7. you cannot access My Account to review the information ?

What version of PHP?
What version of MySQL?
What operating system is your server running?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

8 Nov 2006, 2:11 AM
#11
twirlerzmom avatar

twirlerzmom

New Zenner

Join Date:
Nov 2005
Posts:
60
Plugin Contributions:
0

Re: [Done v1.3.7] account creation bug when displaying create-account-success page

You're saying that:

  1. this is a fresh v1.3.6 install with NO addons ? Yes, I haven't added anything to this store.

  2. switching to "classic" template has the same effect? Not sure I understand what you mean by "switching" to classic. For now I'm putting everything in my classic folder. This is the template I'm using. After I get it all working I copy all my files over to a renamed folder to use as my override folder.

  3. you can create an account, but always get the indicated error? Well I've only tried 2x to create an account and yes both times I got the error. Just for laughs, I created a new test account this time NOT choosing the newsletter option. I get the same blue "primary address" box with the continue button. I clicked continue and it takes me right back to the Welcome Please Sign In page.

  4. you can see the account in the admin? Yep, I am able to see all 3 test accounts.

  5. the address info as seen in the admin is correct? Yes, I just checked again, all info is the same as I entered it.

  6. you cannot log in using this account ? No, when I log in it takes me right back to the Welcome, please log in page.

  7. you cannot access My Account to review the information ? There is no My Account to view! I have 2 things sitting in a cart, I know I should be able to see those but My Account isn't even an option on top.....or anywhere for that matter.

What version of PHP? 4.4.4
What version of MySQL? 4.1.21 standard log
What operating system is your server running? Linux 2.6.9-42ELsmp

8 Nov 2006, 2:32 AM
#12
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,714
Plugin Contributions:
0

Re: [Done v1.3.7] account creation bug when displaying create-account-success page

Tried it in both FireFox (v2) and IE6 - I can't seem to duplicate a problem. Was able to complete the registration and am logged into both accounts.

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

8 Nov 2006, 2:33 AM
#13
drbyte avatar

drbyte

Sensei

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

Re: [Done v1.3.7] account creation bug when displaying create-account-success page

I just created an account on your site with no problem.
I can log into it fine.
I can access My Account fine.
I can place an order fine. Checkout completes fine.

What browser are you using?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

8 Nov 2006, 2:38 AM
#14
twirlerzmom avatar

twirlerzmom

New Zenner

Join Date:
Nov 2005
Posts:
60
Plugin Contributions:
0

Re: [Done v1.3.7] account creation bug when displaying create-account-success page

IE 7........wouldn't be suprised to find that's the whole problem:(

8 Nov 2006, 2:41 AM
#15
twirlerzmom avatar

twirlerzmom

New Zenner

Join Date:
Nov 2005
Posts:
60
Plugin Contributions:
0

Re: [Done v1.3.7] account creation bug when displaying create-account-success page

I just tested it in Firefox and I also was able to create a new account just fine. Perhaps a cache issue? Or maybe it's an issue with IE7?

8 Nov 2006, 2:49 AM
#16
drbyte avatar

drbyte

Sensei

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

Re: [Done v1.3.7] account creation bug when displaying create-account-success page

I just logged in fine via IE7

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

8 Nov 2006, 3:08 AM
#17
twirlerzmom avatar

twirlerzmom

New Zenner

Join Date:
Nov 2005
Posts:
60
Plugin Contributions:
0

Re: [Done v1.3.7] account creation bug when displaying create-account-success page

Well go figure! I dunno, I guess I'll try it again tomorrow after a reboot and see if I continue to have the same problem. I appreciate the point in the right direction with the fix though. It's been very helpful.

8 Nov 2006, 3:23 PM
#18
unn avatar

unn

New Zenner

Join Date:
Nov 2006
Posts:
11
Plugin Contributions:
0

Re: [Done v1.3.7] account creation bug when displaying create-account-success page

No they aren't. DrByte, would you give signing up into my store a shot, as of right now it is unpatched with the initialized array, so it gives me errors in ff2. Plus I also just noticed that I can't log in with ff2. I can with safari though.

8 Nov 2006, 4:38 PM
#19
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,714
Plugin Contributions:
0

Re: [Done v1.3.7] account creation bug when displaying create-account-success page

You can't log in because your server isn't set up properly.

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

8 Nov 2006, 11:31 PM
#20
twirlerzmom avatar

twirlerzmom

New Zenner

Join Date:
Nov 2005
Posts:
60
Plugin Contributions:
0

Re: [Done v1.3.7] account creation bug when displaying create-account-success page

I just wanted to let you know that my problem has been solved and I am able to create a new account just fine now. Mine seemed to be a cache issue after applying that small patch that was mentioned in this thread. Thank you to everyone who took the time to test my store!