Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Error when adding to address book

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 12-16-2014, 07:41 PM
 
JiffyPark JiffyPark is offline
 

Member
  
Join Date: Mar 2013
Posts: 20
 

Default Error when adding to address book

When doing some testing tonight I went to add an address to my address book and the form came up fine. I did notice there were two fields for "State". One was required and the other was not. I left the non-required state field blank. I filled out the form and submitted it and the page came back with an error. I've attached an image of the error I'm getting. Now whenever I click on the address book it instantly pulls up a page with this error on it. The page is also loading with out any CSS or anything since it's all basic text with no formatting.

And I'm not sure if I'm suppose to post this in this XC 5 forum or in another forum.

http://www.interwebernet.com/images/addressbook_error.jpg
__________________
XC 5.1.9
Reply With Quote
  #2  
Old 12-16-2014, 07:50 PM
 
JiffyPark JiffyPark is offline
 

Member
  
Join Date: Mar 2013
Posts: 20
 

Default Re: Error when adding to address book

I just noticed if I click on my user name on the user tab in admin it also pulls up the same error page. Is this a serious issue or can it be resolved easily? The site is being configured for launching in the next few weeks and it hasn't been modified in any way other than basic modules being installed.
__________________
XC 5.1.9
Reply With Quote
  #3  
Old 12-17-2014, 08:05 AM
 
JiffyPark JiffyPark is offline
 

Member
  
Join Date: Mar 2013
Posts: 20
 

Default Re: Error when adding to address book

This morning I created another customer account and then added an address to the address book but this time I also filled in a state in the second state field. I still got the error and now that account can't access the address book nor can I click on that user in the admin panel without creating the same error from within the admin panel as well. So I guess this is an actual bug. Hasn't anybody else ran into this? How do i go about reporting a bug like this?
__________________
XC 5.1.9
Reply With Quote
  #4  
Old 12-18-2014, 04:04 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: Error when adding to address book

Hi JiffyPark!

I cannot recreate this problem on default X-Cart, so this problem requires an investigation in order to determine what exactly causes it. As I see, you have already submitted a report to support@x-cart.com and our support team will take a look at it at the first opportunity.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
  #5  
Old 12-18-2014, 04:05 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: Error when adding to address book

if possible, can you please let me know what country is set to the account that experiences the problem? Also, does this country have states in your X-Cart installation?

It might help with this issue investigation.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
  #6  
Old 12-18-2014, 09:55 AM
 
JiffyPark JiffyPark is offline
 

Member
  
Join Date: Mar 2013
Posts: 20
 

Default Re: Error when adding to address book

I have the "default customer address" country set to USA and disabled the selection for the customer since all my transactions will only be within the US. Also I went and deleted all the UK states from the states listing since it would only confuse customers since I only need US states to show in the list. Could this be causing the issue? I'm still confused why there are two address fields when adding an address to the address book. In the admin panel under "cart & checkout" -> "address fields" there is just the one state field which I have set as required.
__________________
XC 5.1.9
Reply With Quote
  #7  
Old 12-18-2014, 10:49 AM
 
JiffyPark JiffyPark is offline
 

Member
  
Join Date: Mar 2013
Posts: 20
 

Default Re: Error when adding to address book

Well thanks to your question, since it got me thinking, it's kind of fixed now. I re-enabled "Country" as a selection under "address fields. I went through and first disabled all countries other than the US so customers couldn't pick another country. I registered a new customer and it works just fine. I'd rather not have country be a selection since I'm only dealing with US customers but this is fine for now. But I still have an issue with the handful of accounts that created an address before I made this change. Any time they they try to click on address book it pulls up that error page. Is my only course of action to delete those accounts and re-create them? Also is there a way to not have to display the country without this bug coming up?

Oh and I should mention one of the accounts affected in my administrator account so I can't delete and re-create that one. I guess I can just never click on the address book for that account but I'd rather fix the issue instead of ignoring it.

By the way I absolutely love this software. It's very powerful and easy to use.
__________________
XC 5.1.9
Reply With Quote
  #8  
Old 12-18-2014, 12:45 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Error when adding to address book

Hi!

Thank you for the kind words!

As for the issue: can you run the following query in your MySQL console (PHPMyAdmin would work too)?
Code:
select * from xc_profile_addresses;

If the problem is a non-instantiated datatabase table column, it could be fixed with a direct SQL query.

Also, please zip files under the [xc5]/var/log/ directory, then clean the directory and open the page causing the error once again. Now please check logs files in the directory and let us know the full error message (the page shows only a bit of it).

Thanks!
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #9  
Old 12-18-2014, 01:23 PM
 
JiffyPark JiffyPark is offline
 

Member
  
Join Date: Mar 2013
Posts: 20
 

Default Re: Error when adding to address book

Ok I ran the SQL query and this is what came up.

http://www.interwebernet.com/images/myphp_screen1.jpg


And then here are the results from the error file.

Code:
<?php die(1); ?> [18-Dec-2014 14:19:00 America/Los_Angeles] PHP Fatal error: Call to a member function getCountry() on a non-object in /home/jiffypark/tooldepot.net/var/run/classes/XLite/View/Address.php on line 140 [18-Dec-2014 14:19:00] Error (code: 1): Call to a member function getCountry() on a non-object Server API: cgi-fcgi; Request method: GET; URI: /?target=address_book; Backtrace: #0 Includes\ErrorHandler::logInfo(Call to a member function getCountry() on a non-object, 1) called at [/home/jiffypark/tooldepot.net/Includes/ErrorHandler.php:324] #1 Includes\ErrorHandler::handleError(Array ([type] => 1,[message] => Call to a member function getCountry() on a non-object,[file] => /home/jiffypark/tooldepot.net/var/run/classes/XLite/View/Address.php,[line] => 140)) called at [/home/jiffypark/tooldepot.net/Includes/ErrorHandler.php:309] #2 Includes\ErrorHandler::shutdown()
__________________
XC 5.1.9
Reply With Quote
  #10  
Old 12-18-2014, 11:20 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Error when adding to address book

I see "NULL" entries in the "country_code" column. This may cause the error.

Try the following:

1. Backup all your site files and the MySQL database - this will help you to recover your site if something goes wrong on the second step.

2. Run this MySQL query:
Code:
update xc_profile_addresses set country_code = 'US' where country_code IS NULL;

Does this help?
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote

The following user thanks qualiteam for this useful post:
tony_sologubov (12-24-2014)
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 05:08 PM.

   

 
X-Cart forums © 2001-2020