Hi,

I have a taxonomy region (ex: Montreal) with sub-regions (ex: Montreal-Est).
I want to use the "Content has taxonomy with depth" with a depth of 1 so that when users select a region (Montreal) they can find as results all nodes belonging to sub-regions such as Montreal-Est.
I did a simple test and it is not working at all. I have a node referencing the sub-region Montreal-Est and when I select both 'Montreal' (the parent region) or even 'Montreal-Est' the node is not brought back as a result.

Any idea? Thanks

Comments

Nicolas Bouteille’s picture

Switched back to 3.5 on a test site and it did not change anything

Nicolas Bouteille’s picture

Did the same basic test on a different website of mine, pretty clean and basic. Did not work either. Version 3.5
So either I am not using it the way I should either I am starting to think this is a bug.

Nicolas Bouteille’s picture

This is the basic test I do:
Create a taxonomy vocabulary Test with one level of hierarchy : Parent 1 > Child 1.1 & Child 1.2 ; Parent 2
Create a content type Test with a Term Reference (Entity Reference) field using the Test vocabulary.
Create a node Test of type Test and selecting Child 1.1 for the Test field.
Create a view Test displaying nodes of type Test and adding a Content : has taxonomy with depth filter based on the Test vocabulary, select list, display hierarchy in the list, depth = 1.
I test my view:
select '- Any -' > click Apply > the node Test is brought back
select 'Child 1.1' > no results found
select 'Parent 1' > no results found

What do I do wrong?

Nicolas Bouteille’s picture

I have tried several depth config (1, -1, 0) the only success I have had is with depth = 0, when I select 'Montreal-Est' the node is brought back. But then by design with depth = 0 if I select 'Montreal' the node is not brought back anymore... I believe I need the depth > 0 to work.

I got confused with another filter I had setup. Nothing works even depth = 0.

Nicolas Bouteille’s picture

Title: Content : has taxonomy with depth exposed filter not working at all » Content : Has taxonomy terms (with depth) exposed filter not working at all
Category: support » bug

Ok until proven otherwise this is a bug. I wish this is not one and you'll just tell me how I am supposed to make it work.

UK_Rogue’s picture

Nicolas,

although there is a bug on the latest release the originally functionality worked. Can you tell me what all your settings were in the contextual filters. I could probably point you in the right direction for the module before it was updated. NB: does auto preview work when you add a filter value?

Nicolas Bouteille’s picture

Hi,

I am not using any contextual filter here but an exposed filter. In terms of config, as mentioned in #3:
"Content : has taxonomy with depth filter based on the Test vocabulary, select list, display hierarchy in the list, depth = 1."
The bug that you're talking about... is there an issue where I could find some info about it?

UK_Rogue’s picture

Nicolas,

Have you tried a simpler filter by taxonomy term (without depth)? For a 1 level term it would make more sense. I believe for deeper levels you would need to add a relationship to taxonomy terms and then change your filter to use the relationship.

Nicolas Bouteille’s picture

I actually tried using a relationship and simple filters instead but couldn't achieve my needs. I think I definitely need the filter with depth to work in my use case.
You said "there is a bug in the current release" is there an issue about that?
You said "the originally functionality worked" in which version? I tried 3.5 it does not work either. If you could give me a version that works I could compare that one with 3.6 and try to understand what's not working.

Thanks

UK_Rogue’s picture

Nicolas, the other issue was http://drupal.org/node/1956304 but i'm not sure if that's going to help you. I'm pretty sure yours is a config issue. If you have your content tagged with one term and then you filter by that term against the content it should all work fine. Depth is required when...

example master term
- example subterm
- content

Then you need to use depth as your content is attached to a sub term below the master term. Obviously you should still be able to use with depth (0) but I just wanted to see if you could get a basic view set up and working. As a test i just did the following on my site.

Created a new view based on content type product (one of my ecommerce sites:-) - page only
added "has taxonomy term (exposed) to the filter criteria
saved

Auto preview came up straight away with the exposed filter (In my case it was colour) - All worked fine.

I then removed that filter and add Taxonomy with depth - This also worked with depth of (0).

If you can do the same test then at least you know it works with 1 level. Then change the filter to 'with depth' rinse and repeat :-)

Nicolas Bouteille’s picture

Hi,

I am having difficulty understanding what you are advising me to do and to be honest I think you don't understand properly what my use-case is. I am not saying you don't understand, I am saying that I think you might not understand. So before I spend some time trying to understand what you want me to do I just want to be sure you have indeed understood my use-case and that you confirm that your solution (that I don't understand right now) will work.

I have a vocabulary as such:

Parent 1
Parent 2
Parent 3
- Child 3.1
- Child 3.2
Parent 4

Some nodes can be directly referencing parent terms like "Parent 1" or "Parent 2".
Some nodes can be directly referencing Children terms like "Child 3.1"
There cannot be nodes referencing parent terms that have children terms. Ex : there cannot be nodes referencing "Parent 3".

If the exposed filter is set to "Parent 1", all/only nodes referencing "Parent 1" should be retrieved
If the exposed filter is set to "Child 3.1" all/only nodes referencing "Child 3.1" should be retrieved
If the exposed filter is set to "Parent 3" all/only nodes referencing "Child 3.1" & "Child 3.2" should be retrieved

Are you sure I don't need a filter with depth to achieve this?

If you still think that your solution fits my needs, please explain it again and if possible with some more details :)

Thank you!

Nicolas Bouteille’s picture

Category: bug » support
Status: Active » Closed (won't fix)

Ok closing this thread as this is not going anywhere...

Nicolas Bouteille’s picture

In case someone is looking to resolve the same problem: what was causing this behavior not to work for me was an additional filter Content : Published (No).
Indeed, I was just testing the functionality with unpublished contents and unfortunately it was not working because of that.
Here is another issue I created where more explanation on the matter may be found http://drupal.org/node/1967812