Closed (works as designed)
Project:
Taxonomy Views Integrator
Version:
6.x-1.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Sep 2009 at 23:36 UTC
Updated:
25 Aug 2011 at 20:38 UTC
The depth set in a particular view seems to be ignored.
function tvi_render_view() seems to set it the $depth to zero without any arguments passed. Can we assign this depth from the view being read into the function?
I'm not sure the best way to do this - here's some code I added to both the "term override" and "vocab override" within tvi_render_view() that seemed to work. Please test it.
I changed:
return views_embed_view($name, $display, $str_tids, $depth);
to
if ($view_depth=$view->display[$display]->display_options['arguments']['term_node_tid_depth']['depth']) $depth = $view_depth;
return views_embed_view($name, $display, $str_tids, $depth);
Comments
Comment #1
derekwebb1 commentedGood catch... And thanks for the code! Will test and commit it if it checks out. Thanks again.
Comment #2
derekwebb1 commentedYour code gets us most of the way there. Unfortunately, when there is a depth set, unless you override it in your preferred display, it is available only to the default display plugin. So passing in the $display actually botches the thing up...
Seems like a good fix might be to first check if there is a depth on the preferred plugin. If none is found (which is the case if you doi not override the default) then we can look to the default plugin.
That ought to do it
Thanks again. I will be working on this directly.
Derek
Comment #3
derekwebb1 commentedI added a function for getting the depth from the view that seems to work ok. This should accommodate views tendency not to save depth info with all display plugins...
Comment #4
jefftrnr commentedDerek: I just tested your solution and just made a slight change to your function. See below.
Comment #5
derekwebb1 commentedThanks! Glad you caught that.
You saved me another bug report!
Awesome.
[edit] Though the else part is not necessary
we can just have:
return 0;right after the default plugin if conditional...
I will commit and tag these changes shortly.
Comment #6
derekwebb1 commentedChanges committed. Should be available in a few minutes.
Comment #7
Sinan Erdem commentedTried the latest stable version of TVI (1.1), and when I set the depth of a views argument as +2, it ignores the depth and doesnt show the child nodes of a term...
Comment #8
derekwebb1 commentedSorry for the slow reply. Are you setting the depth in the view (Taxonomy: Term ID depth modifier) argument settings or elsewhere? Also, how many arguments are you using in your view. I think it may be limited to the two args described in the readme.txt if you want it to pass arguments. If that is the case then we may have to re-work some code!
Thanks, Derek
Comment #9
zarudnyi commentedSame here. Depth of a view argument is allways 0 (Taxonomy: Term ID depth modifier).
Thanks.
Comment #10
rusdvl commentedI removed 'Taxonomy: Term ID depth modifier' from the view and only had the argument 'Taxonomy: Term ID (with depth)' and that fixed the issue for me...
Comment #11
derekwebb1 commented