WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 3 years ago

#14334 closed defect (bug) (duplicate)

Editing other's post causing fatal error

Reported by: suhanto Owned by:
Milestone: Priority: normal
Severity: critical Version: 3.0
Component: Posts, Post Types Keywords:
Focuses: Cc:

Description

I've created a post type named 'Testimony'.

I also setup capabilities for this post type:

(

'edit_post' => 'edit_testimony',
'edit_posts' => 'edit_testimonies',
others capabilities uses 'post' as default

)

Then I add these two capabilities to admin and subscriber roles:
$role->add_cap('edit_testimony');
$role->add_cap('edit_testimonies');

Then I logged in as subscriber, seeing Testimony menu box containing menu items:

  • Testimony
  • Add New

Then I click Testimony menu item to open my testimonies. But there is also an option to open All testimonies (not just mine). When I click All, I can see all testimonies written by others.

Then I tried to edit a testimony belong to other, when I click Update button, there's an error saying:

Fatal error: Cannot use object of type WP_Error as array in /www/myweb/wp-admin/includes/post.php on line 159

Attachments (1)

fatalerror.png (18.6 KB) - added by suhanto 4 years ago.

Download all attachments as: .zip

Change History (2)

suhanto4 years ago

comment:1 nacin3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.