• Resolved damelco

    (@damelco)


    trying to figure this out …
    doing a bit of source code reverse engineering to figure out where my data is going

    in /class.pmpro-import-members.php
    it looks like you are prefixing some key names in the pmpro_fields array with imported_ starting at line 1649;

    	public function import_usermeta( $user_meta, $user_data ) {
    		foreach ( $user_meta as $key => $value ) {
    			if ( in_array( $key, array_keys( $this->pmpro_fields ) ) ) {
    				$key = "imported_{$key}";
    			}
    			$user_meta[ $key ] = $value;
    		}
    		return $user_meta;
    	}

    however my data seems to disappear around line 1903-1906;

    		$this->pmpro_fields['membership_subscription_transaction_id'] = !empty( $user->import_membership_subscription_transaction_id ) ? $user->import_membership_subscription_transaction_id : null;
    		$this->pmpro_fields['membership_payment_transaction_id']      = !empty( $user->import_membership_payment_transaction_id ) ? $user->import_membership_payment_transaction_id : null;
    		$this->pmpro_fields['membership_affiliate_id']                = !empty( $user->import_membership_affiliate_id ) ? $user->import_membership_affiliate_id : null;
    		$this->pmpro_fields['membership_gateway']                     = !empty( $user->import_membership_gateway ) ? $user->import_membership_gateway : null;

    I’m guessing the amended key names (imported_ prefix) at line 1654 are
    suppose to be the same syntax as the (import_ prefix ) used in lines 1903 – 1906
    yes?

    thanks for the great work though!

    -DJ

    • This topic was modified 8 years, 2 months ago by damelco.
Viewing 1 replies (of 1 total)
  • Plugin Author Thomas S

    (@eighty20results)

    Thank you for that analysis!

    The fix in 2.7 is a little bit different than what you proposed, but you helped me realize that as I ported from the original, I left a piece of code in my version that shouldn’t have been there (causing the subscription_transaction_id, payment_transaction_id, affiliate_id and payment_gateway fields to get zeroed out accidentally).

    I just pushed 2.7 out so it should become available fairly soon.

Viewing 1 replies (of 1 total)

The topic ‘orders not importing’ is closed to new replies.