Results 1 to 10 of 60

Hybrid View

  1. #1
    Join Date
    Nov 2006
    Posts
    11
    Plugin Contributions
    0

    help question [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.

    Code:
    Warning:  Invalid argument supplied for foreach() in /home/httpd/vhosts/eastmedent.com/httpdocs/store/includes/templates/template_default/templates/tpl_create_account_success_default.php on line 26
    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 Code:
      $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

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: account creation bug

    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:
    Code:
      $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:
    Code:
      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:
    Code:
    $addressArray = array();
    , right above this line:
    Code:
    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.

  3. #3
    Join Date
    Nov 2006
    Posts
    11
    Plugin Contributions
    0

    Default Re: account creation bug

    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.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: account creation bug

    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.

  5. #5
    Join Date
    Nov 2006
    Posts
    11
    Plugin Contributions
    0

    Default Re: account creation bug

    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.

  6. #6
    Join Date
    Apr 2006
    Posts
    413
    Plugin Contributions
    0

    Default Re: account creation bug when displaying create-account-success page

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

 

 

Similar Threads

  1. create account success page not displaying!
    By rebelman in forum General Questions
    Replies: 1
    Last Post: 2 Jul 2011, 09:16 PM
  2. account creation success blank page
    By perfcomp in forum General Questions
    Replies: 4
    Last Post: 22 Sep 2009, 02:46 AM
  3. Blank Page on Create Account Success
    By RAM1001 in forum General Questions
    Replies: 5
    Last Post: 31 Aug 2009, 11:44 AM
  4. Bypass create account success page and go to My Account instead?
    By dealbyethan.com in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 3 Dec 2007, 01:50 PM
  5. By-pass Account Create Success Page
    By s_mack in forum All Other Contributions/Addons
    Replies: 9
    Last Post: 22 Dec 2006, 02:12 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR