-
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
Post Author Block doesn't display when author has no posts #40431
Comments
TEST REPORT
After some debug it appears that the bug is due to the missing of postType and postId. introduced here: #19894 (looks like an oversight) ping @draganescu since he spearheaded this part of code and I am not sure what should be the best way to fix this. Should we disable the block when there's no postId? I'm open to any suggestion, and then I can ship a patch. |
@mauriac the problem you reported seems different from the one in the issue. Changing the author outside of a post has no effect since there is no post to edit. I think that drop-down should not show if there is not post. |
Trying to see if it's trivial to bring over the feature the query block has to get post from query. |
So the problem here is that when there are no posts, the author block does not get any post id from the context. This is a quirk of how block context works on the server-side, for some reason if there are posts, the contextual post type and post id are set to the 1st one in the list of posts from the query block. |
I used to think that fix the postId missing will fix this issue, this is due to my first understand of the block purpose; but now I guess you are right. I'll create a new issue related to my problem and I'll probably ship a patch according to your comment ========> I think that drop-down should not show if there is not post. |
Description
If you add a Post Author block to the Author template and view the template for an author without any posts yet, the post author block doesn't display. This was found as part of the thirteenth call for testing for the FSE Outreach Program:
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Here's a quick video of me demonstrating the problem:
https://user-images.githubusercontent.com/26996883/163894155-98f43d27-0442-45b8-96a7-6fb305ca66b0.mov
Environment info
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
The text was updated successfully, but these errors were encountered: