Content Taxonomy does not provide more than one field for a view

SocialNicheGuru - June 24, 2008 - 19:27
Project:Content Taxonomy
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:active
Description

hmmm anyone run into the following problem: I have two fields that I save as content taxonomy. they are taxonomy fields. I can add them to a node just fine. but i would like to add both to the field section as a view. I get "content taxonomy field:" for only one of the two fields which happens to be the first one created.

#1

that0n3guy - June 24, 2008 - 21:16

I also have two fields that I am using just as you are. I only have one "content taxonomy field" in views as well, but when I add this field to my view, I get a page not found error when trying to see that view. If I delect the contect tax.. field, the view works again.

#2

SocialNicheGuru - June 25, 2008 - 14:56

I was trying to fix it and applied patches. NONE OF THEM WORKED... and I wasted two weeks of my life.

So i did a clean install of the module.
I saved all my content types as both
I then used taxonomy term: XXX in my fields
Tax term: for vocab in my filters

I had to slightly modify the template.php and views-xxx.tpl.php files for the corresponding fields.

In many cases instead of "tid", I had to replace with "value".

ex: $field_nameoffield_tid became $field_nameoffield_value

So I am not using the content taxonomy field since it does not show up for all the fields I created.

Chris

#3

that0n3guy - June 27, 2008 - 17:07

I have been using this http://drupal.org/node/180687#comment-899120 widget, but it seems to have a problem w/ IE.

Hierarchical Select should be able to do what we need in version 3 (beta supposedly this weekend)

#4

drupdrips - August 13, 2008 - 22:40

I ran into the same problem and I have been debugging since yesterday and I know why the problem happens. I will share my solution in the interest of those plagued by this problem with the caveat that it may have other side effects based on usage other than how I am using it. Its a one line change in content_taxonomy_views.module. So make sure to test that if you use this workaround you don't break anything else in the process on YOUR site.

The problem shows up anytime you are using a content taxonomy field whose type is not defined as 'multi-valued' OR strictly TAG. When that happens the way the view fields/filters get stored based on the code in "content_taxonomy_views.module" overwrites the $tablename (key) for the multidimensional array $tables[$tablename] holding all the view field/filter info. For TAG and multi-valued type fields this is avoided as the key name gets associated with the field name and stays unique. In the other case, however the key $tablename is the name of the CCK table which is same for the other content taxonomy fields that are not multi-valued/TAG and thus only the last such content taxonomy field value traversed stays saved. That's the effect of seeing only one such filter or field in views config page.

AttachmentSize
content_taxonomy-274438-4.patch 657 bytes

#5

typehost - November 30, 2008 - 03:05

I applied this one line patch - it does seem to bring up the fields that were not showing before without enabling multiple select options. But all of the fields contain all of the values that are related to Content Taxonomy in any category - so they cannot be usefully exposed. I also applied the views taxonomy.inc patch which did not solve the problem.

#6

drupdrips - January 28, 2009 - 05:07

As far as the second issue you are referring to, you may try the suggestion I made in this link :

drupal.org/node/264801

 
 

Drupal is a registered trademark of Dries Buytaert.