Closed andyzito closed 6 years ago
Both good catches on your suggested changes. I'll make them soon -- in the meantime, re: the tests failing, I note that Travis says they didn't fail but errored due to a composer command erroring. That seems unlikely to be caused by the changes here (didn't see it locally, at least). Have you tried re-running the tests?
@azito122 Tests are passing locally. Could you also come up with a test for this new feature? maybe just add some random meta with user ids and have MU-Migration replace them.
Refactored based on maintainer feedback above. Unit tests are in the works.
@nicholasio FYI I think your Travis builds are dead. Even master is failing when I trigger a build from our fork. Not sure what exactly is broken but you can see the error in the build for this pull request, or, I bet, if you trigger a master build on your own Travis.
Update: seems to be a problem with wp-cli
version 2.0.0
and 2.0.1
. At least, when I downgraded to 1.5.1
it solved the problem.
The Travis builds are exploding. In addition to to the problem with wp-cli
, I found that to get the builds to run I had to clear the Travis cache for that branch in between builds.
In terms of the functionality related to this pull request, here are the tests passing, with code matching what's in this branch now. I added the uid_fields
test to the existing update authors test.
@azito122 Let's get the Travis fixed first before merging this. But it looks good overall!
Rebased on current master (travis fixes)
Hmm, travis is still failing on this one. Any idea why?
Looks like travis is passing now.
Yeah, I cleared Travis cache and it seems to have fixed.
The command line argument
uid_fields
will tell MU-Migration that there arepostmeta
fields containing user ids, and that those fields will need to be included in user id mapping on import.This basically just extends the existing functionality around WooCommerce customer field to include an arbitrary set of
postmeta
fields. The WooCommerce field is automatically added to the list of user id fields if WooCommerce is active.Example:
Manual testing indicates that this works. I'd like to develop unit tests, but haven't gotten to it yet.