Posted by Agileware on November 14, 2009 at 1:31pm
Jump to:
| Project: | Taxonomy Redirect |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
$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
#1
I 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.
#2
I 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.
#3
If anyone finds another case where the $nid variable is set to zero please reopen this case and give details.
#4
Automatically closed -- issue fixed for 2 weeks with no activity.