Closed (outdated)
Project:
Token
Version:
6.x-1.14
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Sep 2010 at 14:12 UTC
Updated:
23 May 2016 at 17:08 UTC
Jump to comment: Most recent
I have noticed something that looks like an issue in hook_token_values()
If $type = 'node', then $object->taxonomy will have the following expected structure ...
$node->taxonomy => Array
(
[<tid>] => Term Object
)
Instead, it will be like this ....
$node->taxonomy => Array
(
[<vid>] => <tid>
)
Where tid is the term id, and vid is the vocabulary id.
Asiby
Comments
Comment #1
aleksey.tk commentedI approve this, it is very unexpected behaviour. Imagine that you create your own token with hook_token_list/hook_token_values which will work with taxonomy and will be used to generate an alias to node in pathauto. When you add or update node in hook_token_values you will get $object->taxonomy[vid] = tid. But when you will run bulkupdate from pathauto - you will get $object->taxonomy = array(tid, tid, ...). I understand that this is pathauto related thing, but the problem is deeper - we need normalization of $object in hook_token_values. Something like before running this hook do node_load(nid) or taxonomy_get_term(tid) depending on type of object.
Comment #2
dave reidComment #3
aleksey.tk commentedLooks like we will never get an answer here. Maybe let's just close this task?
Comment #4
asiby commentedWell, we can check if Drupal 7 has the same issue ... unlikely. And Drupal is already being cooked.
I agree to close it.
Comment #5
asiby commentedNo answer received.