Make WordPress Core

Opened 20 months ago

Last modified 18 months ago

#49701 new defect (bug)

Quick Edit fails to populate taxonomy terms when show_in_quick_edit = true, and show_ui = false

Reported by: figureone Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.4
Component: Quick/Bulk Edit Keywords:
Focuses: Cc:


Aloha, we discovered that the show_in_quick_edit property is not being checked when populating a post's taxonomy terms in /wp-admin/edit.php. As a consequence, if show_in_quick_edit is true, but show_ui is false for a given taxonomy, the Quick Edit UI will not check any of the term checkboxes, which can result in losing existing terms when a post is updated via Quick Edit.

Likely this was just an oversight when show_in_quick_edit was introduced here:

And it should be an easy fix to check show_in_quick_edit instead of show_ui here:

show_in_quick_edit defaults to the value of show_ui if it isn't specified, so this change shouldn't introduce any issues.

Our use case:
We have a taxonomy and terms defined in a plugin that is not meant to be edited in the WordPress UI. However, we do want users to be able to assign taxonomy terms to posts in the Quick Edit UI.

Extra details if needed:
When clicking the Quick Edit button, inline-edit-post.js refers to the term divs to mark the correct checkboxes:
Term divs are echoed here:

Change History (7)

This ticket was mentioned in PR #205 on WordPress/wordpress-develop by figureone.

20 months ago

Added tests for hierarchical and nonhierarchical taxonomies with show_ui = false and show_on_quick_edit = true.

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

#2 @figureone
20 months ago

  • Keywords has-unit-tests added

This ticket was mentioned in PR #207 on WordPress/wordpress-develop by figureone.

20 months ago

Fixes 49701 by changing show_ui to show_in_quick_edit when deciding whether to echo the hidden div containing the assigned taxonomy terms for each post on the All Posts screen in WordPress Dashboard.

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

#4 @figureone
20 months ago

  • Keywords has-patch added

#5 @figureone
18 months ago

  • Keywords has-unit-tests has-patch removed

#6 @figureone
18 months ago

Removing keywords; not sure if I jumped the gun on those and that affected core workflow.

#7 @sabernhardt
18 months ago

Related/duplicate: #42916

(The same two changes were proposed for /wp-admin/includes/template.php)

Note: See TracTickets for help on using tickets.