WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 3 years ago

#14093 new defect (bug)

Malformed category hidden from edit-tags, but shows in meta box

Reported by: nacin Owned by:
Milestone: Future Release Priority: low
Severity: normal Version:
Component: Taxonomy Keywords: needs-patch
Focuses: Cc:

Description

Came from a report in IRC by xomp.

In the following example, category 1's parent is category 2, and vice versa.

mysql> select term_taxonomy_id, term_id, taxonomy, parent from wp_term_taxonomy;
+------------------+---------+---------------+--------+
| term_taxonomy_id | term_id | taxonomy      | parent |
+------------------+---------+---------------+--------+
|                1 |       1 | category      |      2 |
|                2 |       2 | category      |      1 |
|                3 |       3 | category      |      0 |
|                4 |       4 | category      |      1 |
+------------------+---------+---------------+--------+
4 rows in set (0.00 sec)

mysql> select term_id, name from wp_terms;
+---------+-----------------+
| term_id | name            |
+---------+-----------------+
|       1 | Category 1      |
|       2 | Category 2      |
|       3 | Category 3      |
|       4 | Category 4      |
+---------+-----------------+
4 rows in set (0.00 sec)

On edit-tags, you'll see only Category 3.

In the hierarchical meta box, you'll see:

Category 3
Category 1
 - Category 2
 - Category 4

If we decide to show corrupted data, we should be consistent. At the very least, edit-tags should reveal more than the meta box, not the other way around.

Change History (4)

comment:1 nacin3 years ago

I imagine this should be handled by [15806].

comment:2 nacin3 years ago

  • Keywords reporter-feedback added

comment:3 ocean903 years ago

nacin, you are the reporter. :)

comment:4 mdawaffe3 years ago

  • Keywords needs-patch added; reporter-feedback removed
  • Milestone changed from Awaiting Review to Future Release

Maybe loop through get_term_children() on upgrade to find and break loops.

Note: See TracTickets for help on using tickets.