I need to load a particular term by its name. I'm using the following PHP snippet to do so (note that I am using node auto-term so the node title is my term):
$terms = taxonomy_get_term_by_name($node->title);
echo $terms[0]->tid;
When this didn't work I attempted something simple just as a test:
$term = '67';
echo $term;
This too did not work. Simply entering 67 into the form works just fine, but php evaluation does not seem to function correctly.
Comments
Comment #1
klausiHave you activated the PHP filter module? (it is required for input evaluation)
Comment #2
eidolon nightYes, the PHP filter is enabled and working. I'm actually using a php conditional in the same rule, and it works fine. Only this snippet isn't working.
Comment #3
klausiHave you tried the dev-version of the module? There has been a commit recently, stating " #512566 patch by Amitaibu: Add eval input to "Add a new vocabulary" action", maybe this could solve your problem?
Comment #4
eidolon nightNo, still nothing. Once again testing with the simplest statement:
May be fixed in "Add a new vocabulary" but I'm using "Load a term". Maybe it's the same issue, but was never addressed in this particular action?
Comment #5
fagoIt should be fixed there too, but be aware that you have to delete and recreate the action so that the changes apply. Please test that.
Comment #6
eidolon nightWorked like a charm. Thank you fago.