Make WordPress Core

Opened 9 years ago

Closed 7 months ago

#41448 closed defect (bug) (worksforme)

Contributors shouldn't be able to change the date of their drafts

Reported by: davilera's profile davilera Owned by:
Milestone: Priority: low
Severity: normal Version: 2.7
Component: Posts, Post Types Keywords: has-patch needs-unit-tests
Focuses: administration, rest-api Cc:

Description

(I'm guessing that) contributors shouldn't be able to change a post's publication date—that's why the Publish box doesn't include the date when logged in as a contributor in the first place. However, if a contributor quick edits a post in the All Posts screen, they'll be able to change the post's date.

We should remove the date field from the Quick Edit form. Or, alternatively, we should allow contributors to edit this date while they're editing a post. Either way, both screens should be consistent.

Attachments (1)

41448.diff (625 bytes) - added by davilera 9 years ago.

Download all attachments as: .zip

Change History (4)

#1 @johnbillion
9 years ago

  • Component changed from Role/Capability to Posts, Post Types
  • Focuses administration rest-api added
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release
  • Priority changed from normal to low
  • Version changed from 4.8 to 2.7

Confirmed. Users who cannot publish a post should not be able to change the post date (introduced in [7409]).

This bug has been present since Quick Edit was introduced in 2.7.

This might affect the REST API too.

@davilera
9 years ago

#2 @davilera
9 years ago

  • Keywords has-patch needs-unit-tests added; needs-patch removed

41448.diff checks whether the current user can publish posts (of the current post type). If they can't (that is, if they're a Contributor), the fields for changing a post's date are not included in Quick Edit.

@johnbillion, I didn't check the REST API. Should we address the (possible) issue with the REST API here, or should we open a separate ticket?

#3 @SirLouen
7 months ago

  • Milestone Future Release deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Reproduction Report

Description

❌ This report can't validate that the issue can be reproduced.

Environment

  • WordPress: 6.9-alpha-60093-src
  • PHP: 8.2.28
  • Server: nginx/1.27.5
  • Database: mysqli (Server: 8.4.6 / Client: mysqlnd 8.2.28)
  • Browser: Chrome 139.0.0.0
  • OS: Windows 10/11
  • Theme: Twenty Twenty-Five 1.3
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

  1. ❌ Error condition is not occurring.

Additional Notes

  • I'm not sure how to reproduce this. Contributors don't have anymore access to Quick Edit. Time to close this as worksforme

Supplemental Artifacts

https://i.imgur.com/mIjenqU.png

Note: See TracTickets for help on using tickets.