Skip to content
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

Dashboard: editor/author user not able to see author information #12866

Closed
swissspidy opened this issue Dec 20, 2022 · 6 comments
Closed

Dashboard: editor/author user not able to see author information #12866

swissspidy opened this issue Dec 20, 2022 · 6 comments
Assignees
Labels
Group: WordPress Changes related to WordPress or Gutenberg integration P3 Nice to have Type: Bug Something isn't working

Comments

@swissspidy
Copy link
Collaborator

Bug Description

Originally reported at #12848 (comment)

Very similar to #12604

A user with editor or author role doesn't necessarily have list_users capabilities, thus the embedded author information is missing due to a rest_user_cannot_view error.

This happens when the other user does not have any published posts.

It's confusing because the author information is available on the classic list table.

Expected Behaviour

Ideally the user should see the author name on the dashboard.

Steps to Reproduce

  1. Create a new admin user
  2. Create a draft story with that admin user
  3. Switch to an editor/author user
  4. Go to stories dashboard
  5. See draft story without admin user's name on it

Screenshots

image.png

Same list view when logged in as admin-user is like this:
image.png

Additional Context

  • Plugin Version: 1.28.0
  • WordPress Version: 6.1.1
  • Operating System: macOS
  • Browser: Chrome
@swissspidy swissspidy added Type: Bug Something isn't working Group: WordPress Changes related to WordPress or Gutenberg integration P3 Nice to have Pod: WP labels Dec 20, 2022
@swissspidy swissspidy mentioned this issue Dec 20, 2022
8 tasks
@spacedmonkey spacedmonkey self-assigned this Dec 21, 2022
@spacedmonkey
Copy link
Contributor

I can't replicate this issue.

Screenshot 2023-01-16 at 16 26 31

@swissspidy
Copy link
Collaborator Author

Try creating a new editor/author user that does not have any published posts yet.

IIRC the issue happens here where there is a count_user_posts check:

https://github.com/WordPress/wordpress-develop/blob/f438c0bff6674eed40a8300dc8145386e9016a5b/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php#L445

@spacedmonkey
Copy link
Contributor

Seems like this is an issue after 88cd0cb. I validated this was an issue in 1.27 and 1.26. But not an issue in 1.28.1.

@swissspidy
Copy link
Collaborator Author

So this is fixed now?
Fixed by #12848 ?

@spacedmonkey
Copy link
Contributor

So this is fixed now? Fixed by #12848 ?

I could not replicate this error when I checked out 88cd0cb. I could replicate in 1.27. Something in 1.28 / 1.28.1 fixed it. I believe it was #12848. I can spent more time to find out what fixed it. This change makes sense. Unless we can replicate this error, we should close this ticket out.

@swissspidy
Copy link
Collaborator Author

Works for me!

@swissspidy swissspidy closed this as not planned Won't fix, can't repro, duplicate, stale Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Group: WordPress Changes related to WordPress or Gutenberg integration P3 Nice to have Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants