-
Notifications
You must be signed in to change notification settings - Fork 59
fix(cli/migrate-co-authors-guest-authors): handle existing email address #3172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
chickenn00dle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and works as expected! Left a small question which can be ignored.
| $user = get_user_by( 'email', $user_data['user_email'] ); | ||
| if ( $user !== false ) { | ||
| if ( self::$verbose ) { | ||
| WP_CLI::line( sprintf( 'User with email %s already exists, email address will be updated.', $user_data['user_email'] ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking question: Should we include the updated email address in the line as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, added in 465fefc
# [4.4.0-alpha.3](v4.4.0-alpha.2...v4.4.0-alpha.3) (2024-06-25) ### Bug Fixes * **cli/migrate-co-authors-guest-authors:** handle existing email address ([#3172](#3172)) ([1946bd0](1946bd0)) * udpate package-lock.json ([0054142](0054142)) * update newspack-scripts to v5.5.1 ([be81e62](be81e62)) ### Features * ensure regenerator-runtime is available (for WP 6.6) ([#3196](#3196)) ([9693e37](9693e37)) * **everlit:** added Everlit to plugins + refactor plugins in connections wizard ([#3188](#3188)) ([88124f8](88124f8))
|
🎉 This PR is included in version 4.4.0-alpha.3 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
# [4.4.0](v4.3.4...v4.4.0) (2024-07-01) ### Bug Fixes * add modified check before updating donation product ([#3183](#3183)) ([208c55e](208c55e)) * allow `exact` prop on Wizard Route ([9da6da9](9da6da9)) * ci / eslint ([1d6adcd](1d6adcd)) * ci / eslint ([b95580a](b95580a)) * ci / eslint ([beadc45](beadc45)) * ci / typescript ([2c1e092](2c1e092)) * circle ci / eslint ([ab74e90](ab74e90)) * circle ci / eslint ([4d383da](4d383da)) * circle ci / eslint ([6389972](6389972)) * **cli/migrate-co-authors-guest-authors:** handle existing email address ([#3172](#3172)) ([1946bd0](1946bd0)) * **js:** skip regenerator-runtime fix for some files ([#3205](#3205)) ([1ecfd11](1ecfd11)) * load optional modules after settings ([#3165](#3165)) ([69cc5ac](69cc5ac)) * merge conflicts and various minor refactoring ([ca4fea8](ca4fea8)) * **pwa:** disable post request interception ([1587232](1587232)) * **reader-revenue-wizard:** separate billing fields section ([#3140](#3140)) ([41fb347](41fb347)) * remove icons import ([136a19a](136a19a)) * small tweaks to migrate-co-authors-guest-authors command ([2baa524](2baa524)) * text overflow ellipse ([d35df0b](d35df0b)) * udpate package-lock.json ([0054142](0054142)) * update newspack-scripts to v5.5.1 ([be81e62](be81e62)) * update newspack-scripts to v5.5.1 ([896caab](896caab)) ### Features * add BoxContrast to components-demo ([23a8e5f](23a8e5f)) * add spinner to registration block submit button ([#3180](#3180)) ([ff1278f](ff1278f)) * added `<hr/>` between site status and quick action components ([982f67b](982f67b)) * added correct icon type to window.newspack_dashboard ([b5a5130](b5a5130)) * added dash card section components ([f9f3992](f9f3992)) * added quick actions component ([d37e3f3](d37e3f3)) * adding brand header and box-contrast component ([afb2e08](afb2e08)) * adding site status component ([ee01d09](ee01d09)) * applied PR feedback, error configuration ([7ef613e](7ef613e)) * boilerplate stylesheet for settings ([5f3f640](5f3f640)) * centralized wizards script initial ([6faf3d2](6faf3d2)) * dashboard & section initial ([eb3d1e6](eb3d1e6)) * dynamic component root loader ([389646a](389646a)) * ensure regenerator-runtime is available (for WP 6.6) ([#3196](#3196)) ([9693e37](9693e37)) * **everlit:** added Everlit to plugins + refactor plugins in connections wizard ([#3188](#3188)) ([88124f8](88124f8)) * icons ([5f3c740](5f3c740)) * initial app boilerplate ([9a3740c](9a3740c)) * initial settings and refactor ([d7d7da8](d7d7da8)) * **pwa:** pr feedback. moved anonymous function to static method ([1143a11](1143a11)) * RSS & WC Memberships ([#3146](#3146)) ([e649199](e649199)) * settings php initial ([e039c4b](e039c4b)) * **wizards:** new dashboard config and localize script ([2938b32](2938b32)) ### Reverts * **ia:** back to `trunk` ([69b2ba0](69b2ba0))
|
🎉 This PR is included in version 4.4.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
All Submissions:
Changes proposed in this Pull Request:
The CAP migration script (#3068) did not account for Guest Authors which have the same email address as an existing WP User (but are not linked to the user). This PR fixes that by adjusting the new WP User's (created from Guest Authors) email.
How to test the changes in this Pull Request:
wp newspack migrate-co-authors-guest-authors --live --verboseand observe a notice about the user's email being updated_migrated-<guest-id>-has been createdOther information: