Make WordPress Core

Opened 2 months ago

Closed 2 months ago

#62516 closed defect (bug) (duplicate)

Multiple categories are unintentionally checked

Reported by: haniwaman's profile haniwaman Owned by:
Milestone: Priority: normal
Severity: normal Version: 6.7.1
Component: General Keywords:
Focuses: ui Cc:

Description

There is a problem with the ID selector in the category checkbox function.
For example, when a category with ID:2 is selected, ID:20-29 is also selected at the same time.

[To check, please]
1.Open the edit screen of a WordPress post.
2.In the list of categories, check the category with a 1-digit ID
3.Confirm that categories with 2-digit IDs starting with the same number are also selected.

[Probable cause]
The cause may be that 'input[id^="in-" + a + "-" + i + '"]' targets the selector with the first match when retrieving the checked categories in wp-admin/js/post.min.js.
When id="in-category-2-1" is checked for first match, id="in-category-20-1" to id="in-category-29-1" are also selected.

[How to fix]
Instead of 'input[id^="in-' + a + '-' + i + '"]', use 'input[id="in-' + a + '-' + i + '"]' so that only the target category is checked.

Attachments (2)

画面収録 2024-11-22 16.50.49.mov (1.7 MB) - added by haniwaman 2 months ago.
62516.diff (597 bytes) - added by haniwaman 2 months ago.

Download all attachments as: .zip

Change History (3)

@haniwaman
2 months ago

#1 @cbravobernal
2 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #62504.

Thanks for reporting the error!

It has been already reported in https://core.trac.wordpress.org/ticket/62504

Note: See TracTickets for help on using tickets.