Skip to content

Conversation

@adekbadek
Copy link
Member

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:

  1. Create a WP User with a particular email and a Guest Author with the same email
  2. Run wp newspack migrate-co-authors-guest-authors --live --verbose and observe a notice about the user's email being updated
  3. Verify the Guest Author is no more and that a WP User with an email address prefixed with _migrated-<guest-id>- has been created

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@adekbadek adekbadek added the [Status] Needs Review The issue or pull request needs to be reviewed label Jun 7, 2024
@adekbadek adekbadek requested a review from a team as a code owner June 7, 2024 07:12
Copy link
Contributor

@chickenn00dle chickenn00dle left a 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'] ) );
Copy link
Contributor

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?

Copy link
Member Author

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

@github-actions github-actions bot added [Status] Approved The pull request has been reviewed and is ready to merge and removed [Status] Needs Review The issue or pull request needs to be reviewed labels Jun 12, 2024
@adekbadek adekbadek merged commit 1946bd0 into trunk Jun 25, 2024
@adekbadek adekbadek deleted the feat/cap-migration branch June 25, 2024 07:54
matticbot pushed a commit that referenced this pull request Jun 25, 2024
# [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))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 4.4.0-alpha.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Jul 1, 2024
# [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))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 4.4.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released on @alpha released [Status] Approved The pull request has been reviewed and is ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants