[wp-trac] [WordPress Trac] #62567: Unexpected actions on categories list update from edit post screen
WordPress Trac
noreply at wordpress.org
Mon Nov 25 14:39:32 UTC 2024
#62567: Unexpected actions on categories list update from edit post screen
--------------------------+-----------------------------
Reporter: iviweb | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Editor | Version: 6.7.1
Severity: major | Keywords:
Focuses: javascript |
--------------------------+-----------------------------
There is an issue when editing categories checklist on post edit screen.
When we are selecting category, some unrelated categories also marking as
checked, and are save as post attached categories.
For example, we have a category with ID=22, and when we are selecting this
one, all categories, matching with the pattern "#category-in-22*" are
checking also, it mean, if we have categories with ids 222,223,224,2225...
etc all these categories are selecting, which is not a correct behavior.
The issue is investigated and the reason of this bug is bad selector
matching in
[https://github.com/WordPress/WordPress/blob/f03be09041d6a06f6fcb5a38fdbb8721c2ee80e1
/wp-admin/js/post.js#L657 wp-admin/post.js:657] where
{{{
$('input#in-' + taxonomy + '-' + id + ', input[id^="in-' + taxonomy + '-'
+ id + '-"]').prop('checked', c);
}}}
query second selector
{{{
input[id^="in-' + taxonomy + '-' + id + '-"]
}}}
causing this issue.
The issue is discovered for default "category" taxonomies list, but this
will happen for any category.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62567>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list