Easy-digital-downloads: VARCHAR limit on customers table email column is too short.

Created on 21 Mar 2018  路  6Comments  路  Source: easydigitaldownloads/easy-digital-downloads

We've had an issue in EDD for a while where customers would disappear in EDD and could not be created.

Today I finally figured it out. EDD sets the email address column for the customers column to a really short 50 characters. However, emails can be longer than this, in fact, WordPress allows for a VARCHAR(100).

What happens if a user enters an email address > VARCHAR 50 atm is the order goes through, but the customer isn't created and then thus not associated with the order due to a silently handled failed DB insert (COLUMN VALUE EXCEEDS SIZE RESTRICTIONS) into the edd_customers table.

Changing this column to a VARCHAR 100 will solve this problem for the future.

We however will also need:

  • ALTER table for existing EDD sites, the good news is this is really performant since we're expanding a varchar width, takes almost no time to do, so this can be a background thing that just happens.
  • A process that finds orders where the EDD email address meta key value is > 50 characters, and for each of those orders, if an attached customer is not there, then create & associate the order.

Ideally this should be done before EDD 3.0 to allow for data normalization.

Title is an ode to the Pippin's White Whale ticket.

component-customers type-bug

Most helpful comment

Actually, I think we should hold off here. I know it's a bug...but with 3.0 we'll be doing a TON of db upgrades, and new table formatting classes. Since we'll have to itterate over everything to migrate the payments, we should just take care of the customer creation during that. Instead of pushing a fast fix, i'd rather go for the solid fix where we're already going through each paymetn with a fine tooth comb.

All 6 comments

@JJJ Ping for EDD 3.0 please? Make sure we make this part of the DB class. I'm going to get something together for the current releases.

@cklosowski we also need the a process that finds orders where the EDD email address meta key value is > 50 characters, and for each of those orders, if an attached customer is not there, then create & associate the order. part as otherwise, a lot of things in EDD are currently broken for those users.

The good news is this should just be a simple db paged routine like others in EDD and it should be quick, only affecting a couple dozen of each 1k orders.

@chriscct7 ah yes. good call. I'll work up an Upgrade routine that only shows up if there are payments with an email address over 50 chars.

Actually, I think we should hold off here. I know it's a bug...but with 3.0 we'll be doing a TON of db upgrades, and new table formatting classes. Since we'll have to itterate over everything to migrate the payments, we should just take care of the customer creation during that. Instead of pushing a fast fix, i'd rather go for the solid fix where we're already going through each paymetn with a fine tooth comb.

Closing out as this is due to be addressed in #6310.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davidsherlock picture davidsherlock  路  5Comments

colomet picture colomet  路  4Comments

mindctrl picture mindctrl  路  4Comments

davidsherlock picture davidsherlock  路  4Comments

mihaijoldis picture mihaijoldis  路  5Comments