-
Notifications
You must be signed in to change notification settings - Fork 51
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
Hotfix/migrate guest authors cli #3724
base: release
Are you sure you want to change the base?
Conversation
Bumps [@wordpress/browserslist-config](https://github.com/WordPress/gutenberg/tree/HEAD/packages/browserslist-config) from 6.15.0 to 6.16.0. - [Release notes](https://github.com/WordPress/gutenberg/releases) - [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/browserslist-config/CHANGELOG.md) - [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/[email protected]/packages/browserslist-config) --- updated-dependencies: - dependency-name: "@wordpress/browserslist-config" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
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.
This seems to work as advertised from my testing. Just want to note though that after the first time I ran the script and the Guest Authors were converted to Users, I was unable to create another Guest Author with the same details because the system prevents the nicenames from being duplicated. So what I did instead was I added an extra character to the display name (which governs what nicename gets created), then manually went into the DB and updated the cap-user_login
field for the GA to match the nicename of the previously converted user. The script worked just fine still, but if this level of intervention (manually updating values in the DB) isn't within the scope of testing please let me know.
All Submissions:
Changes proposed in this Pull Request:
This PR changes the logic of the guest author migration script.
Basically, the script was checking if a guest user already existed as a regular WP user based on the user_login. I'm changing that to check for the user_nicename.
In a regular situation, the nicename will usually be the same thing as the login, but there are cases where they can be different. One of them is when you migrated users from another system and treated these fields in a different way in the database.
CAP uses the
$user->user_nicename
to create and match the author term, and that's why this is the field we should look at.How to test the changes in this Pull Request:
Other information: