X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Error when adding to address book (https://forum.x-cart.com/showthread.php?t=70798)

JiffyPark 12-16-2014 07:41 PM

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

JiffyPark 12-16-2014 07:50 PM

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.

JiffyPark 12-17-2014 08:05 AM

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?

tony_sologubov 12-18-2014 04:04 AM

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.

tony_sologubov 12-18-2014 04:05 AM

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.

JiffyPark 12-18-2014 09:55 AM

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.

JiffyPark 12-18-2014 10:49 AM

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.

qualiteam 12-18-2014 12:45 PM

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!

JiffyPark 12-18-2014 01:23 PM

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()


qualiteam 12-18-2014 11:20 PM

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?


All times are GMT -8. The time now is 06:16 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.