Fix the "Transfer to another user" screen in the hosting dashboard #107645
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes ARC-1294
Proposed Changes
Scenario 1
A CIAB user is attempting to transfer a domain mapping to another user on the same CIAB site. In this case, we only see a "-" since no display name is available and the user id is directly from the CIAB site and is not a WPCOM user id.
Scenario 2
A WPCOM user (with a WoA) site is attempting to transfer a domain mapping to another user on the site. The other user was manually created on the site, then attached to a WPCOM account later. In this case, we see the correct display name for the other user but the user id is still directly from the site and is not a WPCOM user id.
The fix
Previously, we called
/wp/v2/:siteId/usersto populate the "New Owner" pulldown. This (generally) went directly to the remote site.Now we call the
/rest/v1.1/sites/:siteId/users?force=wpcomendpoint. This ensures that we always get the correct WPCOM user data, even in cases like CIAB.Testing Instructions
/ciab/domains/the.external-domain.com/transfer/other-user.Pre-merge Checklist