Closed (duplicate)
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
11 Apr 2011 at 19:51 UTC
Updated:
12 Apr 2011 at 07:49 UTC
Before I upgraded to Views 7.x-3.x-dev (7.x-3.x-beta3 has the same issue) the code below worked when I wanted to provide default filter value with PHP in Contextual Filters:
$node = node_load(arg(1));
if($node) {
foreach($node->field_robot_model[LANGUAGE_NONE] as $term) {
$terms[] = $term['tid'];
}
return implode('+',$terms);
} else {
return;
}
After upgrading the block views (unfortunately I cannot tell which version I had before the upgrade) using this filter stopped working. I suppose this feature works, but the available variables or objects have changed. Is there a documentation somewhere detailing these changes? What is the best way to debug the PHP code written into these fields?
Comments
Comment #1
dawehnerAs always please take care that you provide an export!
Even better it would be cool if this export would be reusable.
One issue could be the rewrite of the taxonomy integration.
So that the contextual filter works, you would have to add a relationship, but this is all just guessing.
Comment #2
tibor.antaloczy commentedThanks for the quick reply. There isn't much in my view that could be reused, but here it is.
How would you start debugging? How can you confirm that the code you write into the field does what you expect it to do? I would love to do it for myself, but I'm stuck...
Comment #3
merlinofchaos commentedI believe this is related to my changes to taxonomy.
As a workaround, do this:
Add the relationship "Content: Taxonomy terms on node" I believe.
Then edit the argument to set it to use the relationship.
We need to address this and attempt to auto-convert some of these items that I made no longer valid. The issue for handling that will be http://drupal.org/node/1122420
So technically we'll mark this duplicate, unless my workaround doesn't actually fix your problem, in which case, please mark this active again. :)
Comment #4
tibor.antaloczy commentedAwesome. It did the trick. Thank you!