Closed (fixed)
Project:
Taxonomy Redirect
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Nov 2009 at 13:31 UTC
Updated:
28 Nov 2009 at 14:30 UTC
$nid variable available to php paths is not available when taxonomy_term_path is called from outside the taxonomy module.
The way it works means it is only available when called from taxonomy_link.
Comments
Comment #1
agileware commentedI moved the code that gets the $nid variable out into it's own function.
The way it currently works works for standard drupal by checking for the node in the previous call to taxonomy_link.
I have added to that a check for the node in a previous hook_nodeapi function.
This means calls to taxonomy_term_path from a nodeapi function will get this $nid variable.
For example taxonomy_breadcrumb.
If there are other cases I think we will just have to add them as they pop up.
As it is now I think it covers most usage.
Comment #2
agileware commentedI have now added another case for when taxonomy_term_path is called from theme templates.
So if it is called from node.tpl.php or something like that the $nid variable will be there.
Comment #3
agileware commentedIf anyone finds another case where the $nid variable is set to zero please reopen this case and give details.