[wp-trac] [WordPress Trac] #33148: Categories are missing in admin category list when child category linked to non-existant parent id

WordPress Trac noreply at wordpress.org
Wed Jan 13 16:50:46 UTC 2016


#33148: Categories are missing in admin category list when child category linked to
non-existant parent id
-------------------------------+------------------------------
 Reporter:  ShawnLunny         |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Taxonomy           |     Version:  4.2.3
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:  administration
-------------------------------+------------------------------
Changes (by boonebgorges):

 * keywords:   => reporter-feedback


Comment:

 @ShawnLunny Thanks for the ticket, and for the link to your WPSE thread.

 @adrianosilvaferreira Thanks to you for the patches. Welcome to WP Trac :)

 I am a bit confused at how the situation in question arises in the first
 place. As I understand it, the problem is that you have three terms A, B
 (child of A), and C (child of B). B is suddenly missing from the database.
 Now, C does not show up in category lists, and term links are incorrect.

 Is that right? If so, how are we getting into this situation? Calling
 `wp_delete_term()` on B will result in C being reassigned to parent=A. I
 assume it arises when deleting something directly from the database,
 without going through `wp_delete_term()`? If that's the case, I'm not sure
 that we should be accounting for the situation: by bypassing WP's built-in
 attempts to preserve data integrity, you risk messing up your data, and if
 we paper over that messed up data, it can result in further corruption.

 All this being said, if there is a way to reproduce the problem without
 directly access the database, then I think we need to address it - though
 I'd wager that the correct solution then is to prevent WP from allowing
 orphaned terms in the first place.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33148#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list