WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 3 years ago

#31977 assigned defect (bug)

Ping status of pages changes to "closed" in quick edit

Reported by: JanVoracek Owned by: pareshradadiya
Milestone: Future Release Priority: normal
Severity: normal Version: 4.2
Component: Posts, Post Types Keywords: good-first-bug has-patch dev-feedback
Focuses: administration Cc:

Description

WP version: 4.2-beta4

Every page is created with ping_status set to "open". If the page is edited in the "full" edit form, the ping_status remains untouched. However, if the page is edited in the quick edit form, the ping_status field is changed to "closed" since WP 4.2.

Since pages don't support the ping functionality, I suppose it shouldn't change the field. Maybe "closed" is the propper one, but it should be set on the creation.

It makes testing of our plugin a little bit tricky.

Thanks. Jan

Attachments (3)

31977.diff (593 bytes) - added by pareshradadiya 3 years ago.
Hidden checkbox added when the post_type_supports() check is fail for trackbacks
31977.1.diff (2.8 KB) - added by pareshradadiya 3 years ago.
Checkbox replaced with hidden field and also puted same thing for comment status
31977.2.diff (2.9 KB) - added by pareshradadiya 3 years ago.

Download all attachments as: .zip

Change History (9)

#1 @boonebgorges
3 years ago

  • Keywords needs-patch good-first-bug added
  • Milestone changed from Awaiting Review to Future Release

I've confirmed the bug, but it doesn't look like it's new to 4.2. As far as I can tell, it's worked this way since the current implementation of Quick Edit went into WP. See https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/class-wp-posts-list-table.php?annotate=blame&marks=1252,1261#L1234 and https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/ajax-actions.php?annotate=blame&marks=1550,1551#L1542 Can you check again to be sure that this was not a problem in 4.1 and earlier?

It looks to me like the simplest fix is to change https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/class-wp-posts-list-table.php?annotate=blame&marks=1252,1261#L1234 so that when the post_type_supports() checks fail (elseif) a hidden input with the current value will be output to the screen.

@pareshradadiya
3 years ago

Hidden checkbox added when the post_type_supports() check is fail for trackbacks

#2 @pareshradadiya
3 years ago

  • Keywords has-patch added; needs-patch removed

#3 @boonebgorges
3 years ago

  • Keywords needs-patch added; has-patch removed

Thanks for the patch, pareshradadiya. A couple things:

  • Let's use <input type="hidden"> rather than hiding with CSS
  • We should be falling back not on 'open', but on the actual 'ping_status' value for the current post
  • Could you fix the whitespace to match coding standards please? :)

#4 @boonebgorges
3 years ago

(Also, we should do the same thing for comment status, which I believe suffers from the same bug.)

@pareshradadiya
3 years ago

Checkbox replaced with hidden field and also puted same thing for comment status

#5 @pareshradadiya
3 years ago

  • Keywords has-patch dev-feedback added; needs-patch removed

#6 @obenland
3 years ago

  • Owner set to pareshradadiya
  • Status changed from new to assigned
Note: See TracTickets for help on using tickets.