Make WordPress Core

Opened 10 years ago

Last modified 9 years ago

#39028 new enhancement

Comments on private posts or specific edge cases can get a confusting white screen error.

Reported by: imath Owned by:
Priority: normal Milestone: Awaiting Review
Component: Comments Version: 4.4
Severity: normal Keywords: needs-patch
Cc: Focuses:

Description

I have a plugin that uses the private status for a custom post type used in private BuddyPress groups.

When a group member tries to comment on one of the post type he's getting a white screen. I've fixed the issue on my side, problem was about caps mapping.

But still, i was pretty confused by this behavior. At first i thought it was a fatal error, but xdebug returned nothing, so i've looked in my error.log again nothing ??

Then i've found some returned WP_Error was missing data like the 403 status in wp_handle_comment_submission(). As this function was introduced in 4.4, i guess it first appeared in 4.4.

I think it could be interesting to have a screen looking like this in this kind of cases :

https://cldup.com/ymyxLMacts.png

I suggest the attached patch.

Attachments (1)

39028.patch (1.9 KB ) - added by imath 10 years ago.

Download all attachments as: .zip

Change History (3)

@imath
10 years ago

#1 @imath
10 years ago

  • Keywords has-patch added

#2 @johnbillion
9 years ago

  • Keywords needs-patch added; has-patch removed
  • Type defect (bug)enhancement

I believe the intention if the current behaviour is to avoid exposing the existence of a private/trash/draft post for users who cannot access it.

The error text displayed for private, trash, and draft posts should be the same as that for posts which do not exist.

Note: See TracTickets for help on using tickets.