Reviewed & tested by the community
Project:
Content Taxonomy
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Oct 2009 at 19:48 UTC
Updated:
16 Jun 2011 at 09:04 UTC
Jump to comment: Most recent file
Comments
Comment #1
artbrock commentedRenamed issue to make it clearer that I'm providing a patch.
Comment #2
jim kirkpatrick commentedWorks very well for me, thank you... Had to re-save the view before it appeared, but that could just be a caching issue. Much better than trying to add a relationship and then stop a load of duplicates...
Thanks again, great!
Comment #3
YK85 commented+1 subscribing
Comment #4
chalee commentedThis patch is not working for me. I'm using Content Taxonomy 6.x-1.0-rc2, Views 6.x-2.6, CCK 6.x-2.5. I copied the patch file into the content_taxonomy module folder and applied the patch to using command:
patch content_taxonomy.module content_taxonomy-6.x-1.0-rc2-views.patch
I checked the content_taxonomy.module file and it has the two lines in the patch file added.
I was now able to see the content taxonomy field when I click add sort field (+) which I was not able to do before. I added the field and chose ascending sort order. However when I save and open my view the entries are not sorted properly. What surprises me is that when I change the sort order to descending, the order of the view entries are reversed, which means the sort field is having some effect but it's just not sorting properly. Can someone assist me. Did I apply the patch correctly? Do I have to do something else for this patch to work? The other method of using relationship is also not working as it is producing duplicates. Thanks in advance for the help.
Comment #5
xjmMarked #536918: How car I sort my view ? as duplicate of this issue.
Comment #6
magnus commentedThanks!
This works really well. I attached a patch for dev in case anyone has problem to apply the patch.
Comment #7
ru.meta commentedI've applied patch for "dev" version and nothing is changed. May be I miss something?
I'm trying to sort by taxonomy content field in table view.
Thanks
Comment #8
magnus commentedCheck under "Sorting" above "Filters". Not in style.
Comment #9
garyabbott commentedI've applied the patch with: drupal 6.16, cck 6x-2.6, views 6x-2.10 and CT 6.x-1.0-rc2 and although the fields show up as arguments, they do not seem to pass anything in. The SQL indicates a value of 0 for the argument.
edit1:
It may have something to do with text versus integer. If I have a number like 2007 as the argument, that gets passed to the SQL as 2007. If I have in a text string like blue, that gets passed as 0.
edit2:
OK, I see now that it is expecting the taxonomy id number (which I guess you said, but I did not absorb in the first post) not the value/name. Not sure yet how to use this as I actually generate a URL (with taxonomy argument for another view call) from a content taxonomy field in the view, which of course has the name, not the id number. Sigh.
edit3:
Back in business. In the argument setup you can turn on taxonomy validator and the option to convert term name to term id.
Comment #10
gagarine commentedI try the patch it work perfectly for me. Thanks
Comment #11
jyg commentedIt seems this applies only to the Sort criteria, not to the Basic Settings' Style of "Table".
If you want to sort taxonomy in a table, use content_taxonomy and follow this: http://drupal.org/node/272424#comment-1254224
Comment #12
mstrelan commentedThe sorting seems to order by term id, not term name. To get around this I have created a relationship for my Content Taxonomy Field. Then in sorting I sort by Taxonomy Term Name, using the aforementioned relationship.
Comment #13
mrgoltra commentedsubscribing
Comment #14
minff commentedIf you want to sort by term name in table-type views, then create a relationship, as described in http://drupal.org/node/272424#comment-1254224 (and referred to in comment #11).
To take it shortly together: (1) add the CCK field that you want to use for sorting as a relationship; then (2) add a taxonomy term as a new field and tie it to the relationship; and then (3) check "sortable" in the style options of the table-type.
Worked for me!
Comment #15
emediquei commentedThe patch worked for me, thanks!
Still, it would be nice if it also supported sorting in the table style. I can't use a relationship since I'm using editablefields.
Comment #16
mastervissie commentedAny plans to apply the patch?