I've set my taxonomy description field to taking a filtered text value. Using the UI, I can edit a taxonomy term, write some HTML, save, and when I view it I see the HTML rendered by my browser.
However when doing this:
$wrapper = entity_metadata_wrapper('taxonomy_term', 123); $wrapper->description->set('<p>My html</p>'); $wrapper->save();
And viewing the term's page, the description comes out with the html converted to entities, i.e. I see
<p>My html</p> instead of a paragraph with
My html as its content.
I notice that
$wrapper->description->value(); // <p><p>p;My html<p></p>
Whereas if I load a term that I have edited with the UI, saving HTML to the description field,
$wrapper->description->value(); // <p>Some html</p>
I've looked at
$wrapper->value()->description and there's no difference between a term with/without the correct/desired behaviour.
Also, I note that with normal fields, when you set a formatted text field you pass/get an array
[ 'format' => 'filtered', 'value' => '<p>the html</p>' ] whereas here I only ever get a string.
Is this something peculiar to taxonomy terms (and is there a workaround or extra code I need)? Have I misunderstood something?