Hello,

I'm wondering why the term description is not filtered using description format when displaying the 'block' "term being viewed : description" inside a panel.

We use panels to override the default display of taxonomy/term/* pages. We display the term description using "Taxonomy term > term description" in panel "add content" dialog box. Description is displayed but only with _filter_autop and filter_xss_admin applied on it instead of using "filtered HTML" filter has it is currently defined in my term.

Related code is in the file ctools/plugins/content_types/term_context/term_description.inc line 23 :

<?php
$block
->content = _filter_autop(filter_xss_admin($term->description));
?>

And the fix for my problem is to replace this line by the following :

<?php
$block
->content = check_markup($term->description, $term->format);
?>

What is the reason why the filter set in term edit form is not used ?

Thanks !

Seb

Files: 
CommentFileSizeAuthor
#4 ctools-formatTaxonomyDescription-1340950-4.patch670 bytespcavanaugh
PASSED: [[SimpleTest]]: [MySQL] 51 pass(es).
[ View ]
#3 term_description_render-1340950-4.patch2.53 KBidflood
PASSED: [[SimpleTest]]: [MySQL] 51 pass(es).
[ View ]
#2 term-description.png34.06 KBjenlampton

Comments

Hm. You are right; I would say this piece of content was not properly ported from D6. It is actually deprecated.

Instead, you should probably be using the Field for the term description instead of this content.

StatusFileSize
new34.06 KB

I stumbled across this too.

It turns out the term description is not a field, but see #569434: Remove taxonomy term description field; provide description field for forum taxonomy for more on that.

It looks like the code that is generating the broken Description pane is the "entity_context" and then "entity_field_extra" content type.

This is doubly confusing for the taxonomy entity, because it asks for a view mode. The only view mode that is enabled for terms by default is the "Default" view mode, and that is not an option in the pane config. If you choose the "Taxonomy term page" view mode, you probably won't get any output anyway.

Version:7.x-1.0-rc1» 7.x-1.x-dev
Status:Active» Needs review
StatusFileSize
new2.53 KB
PASSED: [[SimpleTest]]: [MySQL] 51 pass(es).
[ View ]

I have hit the same issue described in #3. I think it's not 100% identical as what is described in the original report. In my situation this happens when adding a term description referenced by a node. In this case this is the "ctools_entity_field_extra_content_type_edit_form" function which is called and not "ctools_term_description_content_type_render".

I've attempted to fix this but I doubt this is the best way to do that. I've also added the fix described in #0 since this seems good (but not tested on my side).

StatusFileSize
new670 bytes
PASSED: [[SimpleTest]]: [MySQL] 51 pass(es).
[ View ]

The patch/fix in #0 works for me. I don't have a test case for the additional problem described in #3. Here is my patch similar to that in #0.

Also the "term being viewed : description" pane do not work correctly with translations, it always output the original text.

I solved this by using a custom content pane and using the term context variables "%term:i18n-name", "%term:i18n-description".
Another option could be adding a new field to replace the description.

Hope this is useful here.

Status:Needs review» Fixed

Make sense. Committed the patch in #4.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.