Easy-digital-downloads: Customer Meta table registration conflict

Created on 3 Feb 2017  路  5Comments  路  Source: easydigitaldownloads/easy-digital-downloads

/**
 * Register the table with $wpdb so the metadata api can find it
 *
 * @access  public
 * @since   2.6
*/
public function register_table() {
    global $wpdb;
    $wpdb->customermeta = $this->table_name;
}

The above code within class-edd-db-customer-meta.php seems to be causing a conflict with other plugins. One example is Give which uses exactly the same method and also declares $wpdb->customermeta = $this->table_name;.

If I var_export the $wpdb object it shows me that 'customermeta' => 'n3Hu7l3_give_customermeta,'. This is resulting in EDD customer meta being stored in the Give customer meta table rather than the EDD Customer meta table table.

I believe you should look to prefix customermeta. $wpdb->edd_customermeta. In doing so I think that you also need to adjust the customer_id column and prefix - edd_customer_id.

type-bug workflow-no-action

Most helpful comment

@cklosowski in our next major release v1.9 we are going to be updating all references to "customer" to "donor" so this table will be migrated to donormeta most likely, or donor_meta since there should be a space.

All 5 comments

This is interesting. @DevinWalker Seems like we might both have some changes that need to happen here...if that's even possible at this point.

If we prefix our table registration, there isn't a need to set edd_customer_id because we're on our own tables at that point.

@cklosowski in our next major release v1.9 we are going to be updating all references to "customer" to "donor" so this table will be migrated to donormeta most likely, or donor_meta since there should be a space.

@cklosowski I tried that and it caused a query error. Renaming the column resolved it - I may have missed something though

At this time I don't think we can safely change the name, unfortunately. If there are additional reports of this we can consider looking into it further but for now I'm closing as wontfix.

Was this page helpful?
0 / 5 - 0 ratings