WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 7 months ago

#38507 new defect (bug)

Quick Edit: Parent label without input when editing page

Reported by: swissspidy Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: has-patch has-screenshots needs-refresh
Focuses: Cc:
PR Number:

Description

Noticed while working on #18375.

To reproduce:

  1. Delete all pages
  2. Create a new page, save as Draft
  3. Click Quick Edit or Bulk Edit
  4. Notice a 'Parent' label without any dropdown

It might make sense to always use 'show_option_none' in wp_dropdown_pages(), even when there are no pages. However, that might lead to data loss when a parent ID is set but the page does not exist anymore. Instead, the 'Parent' label could be hidden.

Screenshot:

https://cldup.com/tUquX3xYvS.png

Attachments (2)

38507.diff (2.4 KB) - added by Fencer04 3 years ago.
Updated code to check if the dropdown is empty before outputting the variable and dropdown.
38507.2.diff (2.3 KB) - added by swissspidy 3 years ago.

Download all attachments as: .zip

Change History (5)

@Fencer04
3 years ago

Updated code to check if the dropdown is empty before outputting the variable and dropdown.

#1 @Fencer04
3 years ago

  • Keywords has-patch added; needs-patch has-screenshots removed

I added a patch that first sends the output of wp_dropdown_pages() into a variable and check to see if it is empty before outputting the label and dropdown.

@swissspidy
3 years ago

#2 @swissspidy
3 years ago

  • Keywords has-screenshots added
  • Milestone changed from Awaiting Review to Future Release

38507.2.diff is a refreshed patch from the root directory (src) so that it applies cleanly, e.g. when using grunt patch.

Screenshot:

https://cldup.com/fasDtBglFB.png

#3 @desrosj
7 months ago

  • Keywords needs-refresh added

Patch needs to be refreshed to apply cleanly.

Note: See TracTickets for help on using tickets.