Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am using the below code to get the top taxonomy term synonym and use that in the path alias with pathauto. It does not work when creating the node but works 100% of the time when "updating url alias" from the admin/content/node/overview page. Any ideas what I could be doing wrong? I thought it was conflicting with automatic nodetitles but I've disabled it for this content type and it still doesn't work.
Type: Node
if ($node->taxonomy) { foreach($node->taxonomy as $term){
$term_array = taxonomy_get_synonyms($term->tid);
return $term_array[0];
}}
Comments
Comment #1
interestingaftermath CreditAttribution: interestingaftermath commentedAny help would be truly appreciated!
Comment #2
interestingaftermath CreditAttribution: interestingaftermath commentedDesperate for help. Any ideas?
Comment #3
interestingaftermath CreditAttribution: interestingaftermath commentedComment #4
interestingaftermath CreditAttribution: interestingaftermath commentedHAPPY to pay for a fix to this issue. It's important to me. Please?
Comment #5
YK85 CreditAttribution: YK85 commentedsubscribe
Comment #6
interestingaftermath CreditAttribution: interestingaftermath commentedAlthough this exact issue isn't fixed, it's fixed for me here: #965702: Add a token to get the top Taxonomy Term Synonym
Comment #7
hanoiiSorry to come a bit late to this issue, and not 100% sure on how to add it. And also, is very difficult to provide support for very every single specific request that can achieve by this module, but... I think it didn't work like you made it because, IIRC, when you create a node, the $node->taxonomy array is not an array of term objects but rather an array of term IDs.
Comment #9
RaulMuroc CreditAttribution: RaulMuroc commentedSimilar thing proposed recently: https://drupal.org/node/1266020. Slight solution is performanced.
It is a quite interesting feature and needed as well as I saw in different posts. IT would be nice to get answer.
THx.
Comment #10
manuel.adan