-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Check for existing of avatar_urls array before trying to return the avatar img part of user autocomplete fragment #18259
Check for existing of avatar_urls array before trying to return the avatar img part of user autocomplete fragment #18259
Conversation
If I understand correctly, |
@talldan, if you could cast your eyes over this when you get a chance that would be great. The immediate need for this fix has gone, as the issue with missing avatars we had was resolved, but would be good to get this merged in to prevent the same issue if there is ever a regression with the avatars. |
@talldan, @youknowriad - would be good to get this one either merged or closed if you have a chance to look at it in the near future. Thanks. |
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.
I haven't tested this but code-wise this is looking good to me.
…vatar img part of user autocomplete fragment
e66b41c
to
3cf3bd2
Compare
Rebased and did some more manually testing of this, all still works as advertised so will go ahead and merge. |
Description
Currently the user mention autocomplete fails if the site is returning false for
get_option( 'show_avatars' )
.Fixes #18258
How has this been tested?
Tested manually by toggling
show_avatars
Added simple unit test to ensure return of user details fragment doesn't fail if avatars array not set
Screenshots
Before:
After:
Types of changes
Made the packages/editor/src/components/autocompleters/user.js getOptionLabel method defensive to check for existence of the avatar url before trying to set img tag
Checklist: