[wp-trac] [WordPress Trac] #34544: Attaching metadata to shared terms can result in data corruption
WordPress Trac
noreply at wordpress.org
Thu Nov 5 05:13:32 UTC 2015
#34544: Attaching metadata to shared terms can result in data corruption
-----------------------------------+---------------------------
Reporter: boonebgorges | Owner: boonebgorges
Type: defect (bug) | Status: closed
Priority: high | Milestone: 4.4
Component: Taxonomy | Version:
Severity: normal | Resolution: fixed
Keywords: has-patch 2nd-opinion | Focuses:
-----------------------------------+---------------------------
Comment (by dd32):
Replying to [comment:6 boonebgorges]:
> @johnjamesjacoby Thanks for the feedback.
>
> > If the problem is that splitting terms causes metadata to be orphaned
>
> Actually, this is the first time I'd actually thought of the metadata
being orphaned. My immediate concern is a situation like this. Two
taxonomies, `cool_band` and `city`; a term `Chicago` with ID `45`, in each
taxonomy. If you `add_term_meta( 45, 'thumbnail', $photo )`, where
`$photo` is a picture of the Sears Tower, then the thumbnail will also
apply to the `cool_band` Chicago. This is clearly incorrect. More briefly:
the termmeta functions accept only a `$term_id` for identifying a term,
but when terms are shared, `$term_id` is insufficient.
I think it's far enough an edgecase that this would be the expected
outcome if you add metadata to a shared term that's later split. ie. that
is, that the meta is added to the shared term, and meta is duplicated upon
eventual split.
Use-cases like the one outlined above are so edgecase that if you're
using/relying upon that and still using shared terms, you've got bigger
problems that we can't automagically fix.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34544#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list