[wp-trac] [WordPress Trac] #15157: Circular References in Categories
WordPress Trac
wp-trac at lists.automattic.com
Tue Oct 19 20:32:25 UTC 2010
#15157: Circular References in Categories
--------------------------+-------------------------------------------------
Reporter: interlock | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Taxonomy | Version: 3.0.1
Severity: normal | Keywords: category taxonomy
--------------------------+-------------------------------------------------
Came across this with a client this morning.
Basically, it appears that hierarchical taxonomy entries can end up in
circular references quite easily, since the list only appears to filter
out the current term entry, not any possible children entries as well. The
first symptom of this is that the taxonomy entries disappear from the menu
once this occurs. Requiring you to manually edit the database and fix the
parent references. Some plugins also have a very difficult time dealing
with this, leading to unpredictable behaviours and possibly some data
corruption.
Reproducing is easy!
1. Make a category, let's say "Newsletters"
2. Make a sub category, let's say "Newsletters Archive". Let's set the
parent to "Newsletters"
3. Let's go back and edit "Newsletters" and set the parent to "Newsletters
Archive". (You ask yourself why you do this, but silently ignore the
voice...)
Results:
Your category list no longer contains either entry now.
Expected Result:
Changing "Newletters" parent to "Newletters Archive" should result in a
failure to save with a message about, "You cannot set the parent to a
child of its self."
Fix:
Filter the parent selection when editing taxonomy entries to not include
any children of the current entry. Should prevent most instances of this
happening.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/15157>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list