Make WordPress Core

Opened 10 months ago

Closed 8 months ago

#59041 closed defect (bug) (fixed)

Permit trashing patterns with draft status in post editor

Reported by: ramonopoly's profile ramonopoly Owned by: isabel_brison's profile isabel_brison
Milestone: 6.3.2 Priority: normal
Severity: normal Version: 6.3
Component: Posts, Post Types Keywords: has-patch gutenberg-merge dev-feedback fixed-major
Focuses: Cc:

Description

First reported in https://github.com/WordPress/gutenberg/issues/53367

Since 6.3 it's not possible to trash wp_block custom post types that have a post_status of draft.

The wp_block post type has delete_published_posts in the capabilities array only.

Step-by-step reproduction instructions:

  1. Add a pattern in the post editor (wp-admin/edit.php?post_type=wp_block)
  2. Save it in draft status
  3. Go back to the list table
  4. Try to trash the pattern (the row action will not be there)

Attachments (1)

59041.diff (597 bytes) - added by dhruvishah2203 10 months ago.

Download all attachments as: .zip

Change History (14)

This ticket was mentioned in PR #4987 on WordPress/wordpress-develop by @ramonopoly.


10 months ago
#1

Syncing changes from:

Adds delete_posts to the wp_block (patterns) capabilities.

Required to allow users to delete draft posts from wp-admin/edit.php?post_type=wp_block

See Gutenberg issue:

Trac ticket: https://core.trac.wordpress.org/ticket/59041

#2 @ramonopoly
10 months ago

  • Milestone changed from 6.4 to 6.3.1

#3 @johnbillion
10 months ago

  • Version changed from trunk to 6.3

#4 @ramonopoly
10 months ago

Does 59041.diff do anything different to the already-attached https://github.com/WordPress/wordpress-develop/pull/4987?

#5 @dhruvishah2203
10 months ago

I think it's a same @ramonopoly

#6 @audrasjb
10 months ago

  • Milestone changed from 6.3.1 to 6.3.2

WP 6.3.1 is going to be released in the next few days, so let's move this ticket to 6.3.2 to give it more time to be committed and backported.

#7 @isabel_brison
9 months ago

  • Owner set to isabel_brison
  • Resolution set to fixed
  • Status changed from new to closed

In 56577:

Post Types: allow trashing draft patterns.

Adds delete_posts to capabilities for the wp_block post type.

Props ramonopoly, johnbillion, dhruvishah2203, audrasjb.
Fixes #59041.

@isabel_brison commented on PR #4987:


9 months ago
#8

Committed in r56577.

#9 @isabel_brison
9 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening this ticket so it can be backported to 6.3.

#10 @isabel_brison
9 months ago

  • Keywords dev-feedback added

This ticket was mentioned in Slack in #core by joemcgill. View the logs.


9 months ago

#12 @joemcgill
9 months ago

  • Keywords fixed-major added

Thanks @isabel_brison. The change in r56577 looks good to me.

#13 @audrasjb
8 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 56777:

Post Types: allow trashing draft patterns.

Adds delete_posts to capabilities for the wp_block post type.

Props ramonopoly, johnbillion, dhruvishah2203, audrasjb, isabel_brison, joemcgill.
Merges [56577] to the 6.3 branch.
Fixes #59041.

Note: See TracTickets for help on using tickets.