Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.4k stars 1.98k forks source link

User Profile: Editing biography, display name and so on in WP Admin isn't possible. #56574

Closed kdevnel closed 4 days ago

kdevnel commented 2 years ago

Quick summary

Following this PR - https://github.com/Automattic/jetpack/pull/20479

This has created a situation where any user who has previously edited their profile details from WP Admin can no longer access the fields to edit them with SSO enabled.

The options are to either update the WordPress.com profile or to disable SSO so the fields are then available in WP Admin.

This is problematic for users with multiple sites since the only option for them to now have separate author information for multiple sites is to not use SSO or to have multiple WordPress.com accounts with separate user information.

Ideally, we should consider a way so it's always possible to have separate profile information for individual sites on an account for that user to make management easier.

Steps to reproduce

  1. Disable SSO and then edit the user biography and display name for a site
  2. Enable SSO and notice there is no way to edit these fields anymore except by changing the user profile in WordPress.com

What you expected to happen

To be able to still have a way to change user profile details per site

What actually happened

It's only possible to change the profile details with SSO disabled or by having multiple accounts with different profile info.

Context

4327524-zd-woothemes

Operating System

No response

Browser

No response

Simple, Atomic or both?

Simple, Atomic

Theme-specific issue?

No response

Other notes

No response

Reproducibility

Consistent

Severity

Some (< 50%)

Available workarounds?

Yes, difficult to implement

Workaround details

There are 2 workarounds:

  1. Disable SSO
  2. We can change this for the user directly on the site using internal tools
  3. Create a new WordPress.com account to handle different profile info
kdevnel commented 2 years ago

Related discussion: p9GEWz-OB-p2

Robertght commented 2 years ago

Flagging this for Flow Patrol Manage to take a second look. Also pinged in the P2 post.

kriskorn commented 2 years ago

Another report: 32868074-hc

philnick206 commented 2 years ago

Reported in #4857204-zen

ClassicRKR27 commented 2 years ago

Reported here in 5241009-zd-woothemes

annbingle commented 1 year ago

Profile description not updating 25074156-hc

Workaround: I updated their profile description in CLI.

github-actions[bot] commented 1 year ago

Support References

This comment is automatically generated. Please do not edit it.

liviopv commented 1 year ago

Another:

druesome commented 3 months ago

One more case: 8262381-zen

Shared a code snippet that would allow the user to edit the Author Bio directly in Users > Profile (ie https://site.com/wp-admin/profile.php)

add_action('show_user_profile', 'add_user_description_field');
add_action('edit_user_profile', 'add_user_description_field');

function add_user_description_field($user) {
    $description = get_user_meta($user->ID, 'description', true);

    ?>
    <h3>Author Bio</h3>
    <table class="form-table">
        <tr>
            <th><label for="description">Author Bio</label></th>
            <td>
                <textarea name="description" id="description" rows="5" cols="30"><?php echo esc_textarea($description); ?></textarea>
            </td>
        </tr>
    </table>
    <?php
}
add_action('personal_options_update', 'save_user_description_field');
add_action('edit_user_profile_update', 'save_user_description_field');

function save_user_description_field($user_id) {
    if (current_user_can('edit_user', $user_id)) {
        if (isset($_POST['description'])) {
            update_user_meta($user_id, 'description', sanitize_text_field($_POST['description']));
        }
    }
}

Set the snippet to Only run in administration area and press Save Changes and Activate.

It would look like this:

image
mrfoxtalbot commented 3 weeks ago

I think this is no longer an issue now that we have untangled Calypso and Bios can be edited serparetly on local sites... right @fushar @taipeicoder?

I am going to close this but feel free to reopen if necessary.

fushar commented 3 weeks ago

@mrfoxtalbot, thanks for the timely ping. We recently tried to make those display name / bio -related fields untangled for all sites as part of pbxlJb-63Y-p2... but we ran into a rabbithole, documented here: pbxlJb-67I-p2. In summary:

This is confusing even for developers when testing the behaviors (we did some kind of internal personal walkthrough before planning to do usability testing). We considered this as "bug" / missed case from the Untangling Calypso project.

In short -- for Classic sites, we re-tangled those user profiles back so that the source of truth is /me. We ran out of "appetite" (time budget) for this project. In the future, if we want to try untangling these fields again, we need to take this Gravatar commenting journey into account.


P.S: just to confirm that all the above only apply to wpcom users. For example, local Atomic users already able to set them per-site.

fushar commented 3 weeks ago

cc: @okmttdhr

mrfoxtalbot commented 3 weeks ago

Thank you for the super derailed explanation @fushar.

I'll come back to this to ensure it's documented and HEs are in the loop.

mrfoxtalbot commented 3 weeks ago

Coming back to this @fushar, I noticed we added some details alongside a direct /me link for the email and name ("You can modify your profile..."): Screenshot 2024-08-27 at 18 42 57

Is there a reason why we have not done the same for the Bio section to avoid confusion?

Screenshot 2024-08-27 at 18 43 09

If this was an oversight, can we include that same message there?

Thank you!

fushar commented 1 week ago

The idea is to co-locate all fields that are managed on /me to a single notice. It includes Contact Info -> Website and About Yourself -> Biographical Info:

image

The "more correct" way is to keep the above two fields and add a notice on each of them. However, that will make the page very crowded with links. What do you think?

mrfoxtalbot commented 1 week ago

Mmmm... I agree that it does not look great but i feels inconsistent to add the notice only to some fields. This is what I see now:

Screenshot 2024-09-10 at 18 45 41

Is this what we are going with @fushar?

fushar commented 5 days ago

Is this what we are going with @fushar?

Yeah, this is the existing production behavior; a compromise between correctness and conciseness. 😅

mrfoxtalbot commented 4 days ago

Got it. Thank you @fushar. I included this in our revision of SSO docs.