WordPress.org

Make WordPress Core

#38174 closed defect (bug) (fixed)

Cannot add a new category from the post edit screen

Reported by: littler.chicken Owned by: obenland
Milestone: 4.7 Priority: high
Severity: normal Version: 4.7
Component: Taxonomy Keywords: has-patch
Focuses: administration Cc:

Description

In trunk, when creating or editing a post (or CPT), adding a new category from within the post editor appears to be broken. Only hierarchical taxonomies are affected--it is possible to add new tags, but any taxonomy which behaves like a category has the same issue.

Creating a new category from the Categories screen works as expected, and any existing category can be selected from the post editor, it's just that creating a new one doesn't work.

I'm not seeing any JS errors, just nothing happens when the "Add New Category" button is clicked after entering the new category/term name. It does not matter if there is a parent term selected.

Attachments (1)

38174.diff (512 bytes) - added by dlh 11 months ago.

Download all attachments as: .zip

Change History (5)

#1 follow-up: @dlh
11 months ago

I can replicate this behavior, and I think it might be traceable to r38599.

Previously, the call to process() inside init() didn't pass the current element, so, inside process(), $element would be set to $( document ) while registering event handlers.

Restoring the previous version of init() seems to fix the issue. But as I'm not certain why init() was changed, going back might cause side-effects that I've overlooked, if it's even the right course to begin with.

@dlh
11 months ago

#2 @johnbillion
11 months ago

  • Focuses administration added
  • Keywords has-patch needs-testing added
  • Milestone changed from Awaiting Review to 4.7
  • Owner set to obenland
  • Priority changed from normal to high
  • Status changed from new to assigned

cc @obenland

#3 in reply to: ↑ 1 @obenland
11 months ago

  • Keywords needs-testing removed

Replying to dlh:

Restoring the previous version of init() seems to fix the issue. But as I'm not certain why init() was changed, going back might cause side-effects that I've overlooked, if it's even the right course to begin with.

It should be, I'm pretty sure I just misread what init() does there.

#4 @obenland
11 months ago

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

In 38711:

wpLists: Pass the current element to process() to properly register event handlers.

Fixes a bug where new categories couldn't be added from the post edit screen.
Introduced in [38599].

Props dlh.
Fixes #38174.

Note: See TracTickets for help on using tickets.