Skip to content

Conversation

@adekbadek
Copy link
Member

@adekbadek adekbadek commented Apr 17, 2024

All Submissions:

Changes proposed in this Pull Request:

Adds a CLI command to migrate off the usage of Co-Authors Plus' "Guest Authors" feature.

See 1200550061930446-as-1206481527608031/f

How to test the changes in this Pull Request:

  1. Switch newspack-blocks to fix/hpb-author-url branch (fix(homepage-articles): author URL newspack-blocks#1710)
  2. Make sure you have the co-authors-plus plugin active
  3. Create a few authors:
    1. (A) a regular WP User
    2. (B) a regular WP User, mapped to a Guest Author*
    3. (C) a Guest Author without any mapping
    4. (D) a Guest Author with a certain slug**
    5. (E) a regular WP User with the user login the same as the slug from user D
  4. Create or edit some posts, so that each author has at least one post assigned
  5. Add all possible metadata to at least one Guest Author
  6. Visit each author's archive page (/author/<slug>) and take note of the slugs
  7. Insert a Homepage Posts block somewhere, that will display the posts
  8. Now run the command: wp newspack migrate-co-authors-guest-authors --verbose --live
  9. Visit the Users -> Guest Authors wp-admin screen and observe it's empty
  10. Visit all the author archive pages and observe nothing changed (the URL is the same, the posts listed and author data also)
  11. Observe that the Homepage Posts block has correct links to author archives

* Create a Guest Author and use the "WordPress User Mapping" input
** Will be generated after creating the Guest Author, see "Unique Slug" disabled input

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?

Base automatically changed from feat/contributor-no-edit-role to trunk May 9, 2024 13:36
@adekbadek adekbadek force-pushed the feat/migrate-guest-authors branch from 15987be to 38f8917 Compare May 10, 2024 07:28
@adekbadek adekbadek marked this pull request as ready for review May 10, 2024 07:29
@adekbadek adekbadek requested a review from a team as a code owner May 10, 2024 07:29
@adekbadek adekbadek added the [Status] Needs Review The issue or pull request needs to be reviewed label May 10, 2024
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.

Works as described. I had one issue with this step of testing:

Create or edit some posts, so that each author has at least one post assigned

I was not able to assign a post to the regular unlinked WP user that shares a login with a guest author ((E) a regular WP User with the user login the same as the slug from user D). The unlinked WP user was automatically assigned the same posts as the guest author.

That said, I think this might be the expected behavior of CAP, so going to approve 👍

@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 May 14, 2024
@adekbadek adekbadek merged commit 7ea8273 into trunk May 16, 2024
@adekbadek adekbadek deleted the feat/migrate-guest-authors branch May 16, 2024 11:24
matticbot pushed a commit that referenced this pull request May 20, 2024
# [4.0.0-alpha.6](v4.0.0-alpha.5...v4.0.0-alpha.6) (2024-05-20)

### Bug Fixes

* **data-events:** handle no ga_client_id in data ([fc4fc9f](fc4fc9f))
* **registration-block:** prevent undefined variable warning ([8af9d89](8af9d89))
* **starter-content:** make the starter content generation idempotent ([d5e10ff](d5e10ff))

### Features

* **cli:** command to migrate CAP guest authors to WP users ([#3068](#3068)) ([7ea8273](7ea8273))
* custom role for assignable authors who don't edit posts ([#3066](#3066)) ([7b89053](7b89053))
* support for wrapping rss titles in cdata ([#3104](#3104)) ([8b3a3be](8b3a3be))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 4.0.0-alpha.6 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@matticbot
Copy link
Contributor

🎉 This PR is included in version 4.0.0-epic-ras-acc.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request May 28, 2024
# [4.0.0](v3.8.8...v4.0.0) (2024-05-28)

### Bug Fixes

* autocomplete orders only for virtual products ([#3111](#3111)) ([bfbe554](bfbe554))
* **data-events:** handle no ga_client_id in data ([fc4fc9f](fc4fc9f))
* ensure only admins can reset starter content and newspack options ([#3081](#3081)) ([4606721](4606721))
* **registration-block:** prevent undefined variable warning ([8af9d89](8af9d89))
* **starter-content:** make the starter content generation idempotent ([d5e10ff](d5e10ff))

### Features

* add product option to autocomplete orders ([#3072](#3072)) ([4a2859b](4a2859b))
* **cli:** command to migrate CAP guest authors to WP users ([#3068](#3068)) ([7ea8273](7ea8273))
* custom role for assignable authors who don't edit posts ([#3066](#3066)) ([7b89053](7b89053))
* **ras:** skip campaign setup ([#3051](#3051)) ([9ef0e6d](9ef0e6d))
* support for wrapping rss titles in cdata ([#3104](#3104)) ([8b3a3be](8b3a3be))

### BREAKING CHANGES

* Changes order autocompletion behavior for existing products!

* feat: add product option to autocomplete orders

* chore: update outdated docblock description
@matticbot
Copy link
Contributor

🎉 This PR is included in version 4.0.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 on @epic/ras-acc 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