When enabling the Taxonomy option for tweeting, the following error occours:
Fatal error: Call to undefined function taxonomy_node_get_terms_by_vocabulary() in /home/snugug/staging.snug.ug/sites/all/modules/contrib/tweet/tweet.module on line 186
The function taxonomy_node_get_terms_by_vocabulary is not a D7 function, and an API search hasn't turned up a similar function; but this is something that needs to be fixed

CommentFileSizeAuthor
#5 tweet.module.patch1.3 KBagerson
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mgifford’s picture

I can confirm this is a problem with my install of the code.

Paragon’s picture

It happens to me as well. It was working fine before...I'll post back if I figure out what's different.

Edit: 10 seconds later, I see that all I did was select some options from the menu, "Include taxonomy terms from these vocabularies as #hashtags in tweets when used in the current node".

Paragon

IceCreamYou’s picture

Yeah, I know it's a problem. There's no immediately obvious fix and I won't have time to work on it for a few weeks. Sorry.

agerson’s picture

taxonomy_node_get_terms_by_vocabulary() used on line 186 of the tweet.module is not available in drupal 7. This should work

<?php
function taxonomy_node_get_terms_by_vocabulary($node, $vid, $key = 'tid') {
  $result = db_query('SELECT t.tid, t.* FROM {taxonomy_term_data} t INNER JOIN {taxonomy_index} r ON r.tid = t.tid WHERE t.vid = :vid AND r.nid = :node_nid ORDER BY weight', array(':vid' => $vid, ':node_nid' => $node->nid));
  return $result->fetchAll();
}
?>
agerson’s picture

Version: 7.x-4.1 » 7.x-4.x-dev
Status: Active » Needs review
FileSize
1.3 KB
IceCreamYou’s picture

Thanks for the patch. Will take a look when I get a chance.

IceCreamYou’s picture

Status: Needs review » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.