Skip to content

Post Author block displays "0" in the inspector controls #51342

@mcliwanow

Description

@mcliwanow

Description

When using the Post Author block as an Editor, the getUsers() returns an empty list of authors and "0" is displayed in the inspector controls

Screenshot 2023-06-08 at 16 23 13

My guess would be that Editor cannot change the author of the post (which makes sense) but "0" shouldn't be displayed. It should be enough to change the following line to actual boolean check

Step-by-step reproduction instructions

  1. Add a post as an admin
  2. Create a post or page
  3. Log in as another user with Editor role
  4. Add a Post Author block to the previously added page (or to a new one)

Screenshots, screen recording, code snippet

No response

Environment info

  • Wordpress Version 6.3-alpha-55896 (started with wp-env)
  • Gutenberg current trunk 16.0.0-rc.1

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions