Jump to content

Address Book Getting Mixed Up


Jason Milldrum

Recommended Posts

Currently using Cubecart 6.0.2, started with 6.0.0 right when it was released.

I had a customer email me yesterday stating that the address information on his order was from a completely different customer. A bit of investigation showed that yes, this customer did create an account with his own information, but for some reason Cubecart pulled the address information from a completely different previously registered customer to populate the default address fields. Fortunately he caught it and brought it go my attention before I shipped his order.

In looking back in the customer list, I see that many (but not all) of my customers seem to have default address pulled from previously registered customers. You can see the problem this presents, even if the customer catches it before placing an order.

The software was updated from 6.0.0 to 6.0.2 right back when 6.0.2 was first released and didn't receive any indications there were problems. I'm fairly certain that the database schema was upgraded. Just to be sure, I downloaded 6.0.2 again and tried to reinstall it, but the system said I was already at the latest version and wouldn't let me proceed.

I do see an error in the logs which is probably related, as it seems to be thrown for the customers who have this issue. A redacted sample is:

File: [user.class.php] Line: [365] "INSERT INTO `cube_CubeCart_customer` (`title`,`first_name`,`last_name`,`email`,`phone`,`mobile`,`password`,`new_password`,`ip_address`,`registered`,`type`) VALUES ([REDACTED]);" - Duplicate entry '[REDACTED]' for key 'email'

Orders also seem to be attributed to the wrong customers, which is also quite problematic. Obviously, this is disturbing to my customers, so any help I can get in resolving this quickly would be greatly appreciated, thanks.

Link to comment
Share on other sites

Welcome Jason Milldrum! Glad to see you made it to the forums.

This error is almost exactly like an error I was working on a few days ago. Fortunately, CubeCart Ltd was able to run the upgrade script and that seems to have fixed it. Unfortunately, a detailed description what precisely was amiss and the specific changes this upgrade script actually made has not (yet) been revealed to me.

Using an external utility such as phpMyAdmin, would you please check to see if there is a column present in the CubeCart_admin_users table named 'tour_shown"?

If that column is not there, then the database got a partial upgrade.

During any upgrade of CubeCart, do recall there being any abnormalities?

The INSERT query fails as it does because the 'email' column has a UNIQUE parameter for its status as a index into the table. Which means that, for some reason, CubeCart is not finding that customer's record to update, and instead wants to insert a new record.

Link to comment
Share on other sites

Thanks for the prompt reply!

I used phpMyAdmin and looked at the database. There is a 'tour_shown' column in the CubeCart_admin_users. I don't recall any error messages or other hiccups during the upgrade process.

Is there a way I can force the installer to do the upgrade again? Or some other way to manually fix the database?

Link to comment
Share on other sites

To "fool" CubeCart into thinking the database is at a level lower than the codebase, in the table CubeCart_history, find the record that indicates "6.0.2" and delete it.

That should make CubeCart think the database is at the version equal to the highest version in the 'version' column. That said, you may also want to delete the record that indicates "6.0.1" and delete that too.

But manually fixing the database suggests that we know exactly what is amiss with it. And we don't know what that would be.

Personally, if what you say is that this problem is persistent and repeatable, I would really enjoy digging around in your store's installation and database. But you've got a business to run.

Link to comment
Share on other sites

Yes, the problem is that I can't find a repeatable pattern to the issue. Not every customer has this problem, and I'm not sure what is triggering it. I don't have a high volume of sales, so it may be a bit difficult for me to have enough data to pin down the exact issue.

The version listed in Dashboard > Store Overview is 6.0.2. I don't know if that pulls from the codebase or from the database, but perhaps that would help. I can delete those records in CubeCart_history and try to run the setup script again, if you think that has a decent chance of not messing up things further. I have already backed up my store and database a few times in the last few days, so I'm probably fairly safe from data loss.

Link to comment
Share on other sites

The version shown in the Store Overview is from the codebase, ini.inc.php, specifically.

When logging in to the admin (not just returning to the admin already logged in), CubeCart should give an advisory that the database is at a lower version than the codebase.

All I would need is one customer where the problem is repeatable. Then I could trace out the code and see what's going on.

But the developer should be coming online in about 10 hours, so if the update script doesn't smooth out this wrinkle, maybe the developer has a better idea.

Link to comment
Share on other sites

OK, I deleted the records from CubeCart_history and re-ran the upgrade script. Had a few hiccups restoring the old site, but I think I got all of them ironed out. At least the bulk of the store data didn't get lost.

I believe that all I can do at this point is keep a close eye on new customer records to see if this pops up again. If so, I'll try to bring more data to you. Thanks again bsmither.

Link to comment
Share on other sites

As best you can, probably needing to review the customer's actions, we would very much like to know what were the steps the customer took.

1 -- Created a new account from the info entered at the checkout screens, or
2 -- Created a new account before adding anything to the shopping basket, then adding to the basket and going to checkout, or
3 -- Already has an account and wanted to add another address, or
4 -- After creating the new account from 1 or 2 above, went to their Address Book and found stuff already there, or
X -- whatever the steps were.

Did the customer leave it as it was so it can be analyzed? Or did the customer delete what was there and entered correct info? If overwritten, did the customer mention what was actually there?

In admin, view this new customer's details. Observe the customer's addressbook. If the customer did not change anything, is there anything there? (That is, the customer sees wrong data, but you don't see any data at all.)

In CC6, the admin is able to view the storefront as if you were that customer. I do not know if, in this state, you have access to that customer's account setting and address book.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...