Skip to:

Opened 8 months ago

Last modified 8 months ago

#3252 new defect

404 page received when author calls post with pending status

Reported by: wpturk Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: trunk
Component: Component - Topics Keywords: needs-patch


I have the latest version 2.6 RC7

If a post goes to status=pending the author directly gets 404 page.

ex: the pending post called by author : is directed to 404 page.

I use moderation tools plugin and when a user submits a topic, the user sees directly a 404 page due to the problem above.

My test environment is version: 2.6 RC5 and there it's working fine. Authors can see their pending posts.

Please, let me know, if there is a quick fix?

Change History (1)

#1 @wpturk
8 months ago

  • Component changed from General to Component - Topics
  • Keywords needs-patch added
  • Priority changed from highest to normal
  • Severity changed from blocker to normal

It took me some hours but I found the code snippet which is causing the problem:


                               // User is author so allow edit if not in admin, unless it's past edit lock time
                                } elseif ( ! is_admin() && ( (int) $user_id === (int) $_post->post_author ) ) {

                                        // Only allow if not past the edit-lock period
                                        $caps = ! bbp_past_edit_lock( $_post->post_date_gmt )
                                                ? array( $post_type->cap->edit_posts )
                                                : array( 'do_not_allow' );

Replacing it with the code below fixes the problem:

  // User is author so allow edit if not in admin
                                } elseif ( ! is_admin() && ( (int) $user_id === (int) $_post->post_author ) ) {
                                        $caps = array( $post_type->cap->edit_posts );
Note: See TracTickets for help on using tickets.