Make WordPress Core

Opened 4 months ago

Closed 4 months ago

Last modified 4 months ago

#62625 closed defect (bug) (duplicate)

Checkboxes under the popular-category class in the category checklist behave unexpectedly.

Reported by: elisavet2ww's profile elisavet2ww Owned by:
Milestone: Priority: normal
Severity: major Version: 6.7.1
Component: Taxonomy Keywords:
Focuses: Cc:

Description

Selecting or interacting with certain categories inadvertently checks or unchecks unrelated checkboxes within the hierarchy. For examle the category has the id 25 and every category that includes number 25 will be trigger, like 258, 250, 251 etc.

The problem exist even i have disable all plugins and by using theme Twenty Twenty-Five.
The problem is reproducible in multiple browsers (e.g., Chrome, Firefox).

Steps to Reproduce

  1. Create a category item and check it's id - example "1", ensure that it will have the class "popular-category."
  2. Create another category (or subcategory) that will have id that starts with number 1, like 13
  3. Attempt to select the category with id 1 when creating a new post, you will see that category with id 13 will be also checked.

The issue appears to stem from this part of the script post.min.js

and this part of code:

h("#" + a + "checklist, #" + a + "checklist-pop").on("click", 'li.popular-category > label input[type="checkbox"]', function() {
    var t = h(this),
        e = t.is(":checked"),
        i = t.val();
    i && t.parents("#taxonomy-" + a).length && (h('input[id^="in-' + a + "-" + i + '"]').prop("checked", e),
    h("input#in-popular-" + a + "-" + i).prop("checked", e))
});

Change History (3)

#2 @narenin
4 months ago

  • Keywords close added
  • Resolution set to invalid
  • Status changed from new to closed
Last edited 4 months ago by narenin (previous) (diff)

#3 @sabernhardt
4 months ago

  • Keywords has-dev-note close removed
  • Milestone Awaiting Review deleted
  • Resolution changed from invalid to duplicate

Duplicate of #62504.

Note: See TracTickets for help on using tickets.