I'm getting the following error message when I try to refresh a Leech feed:
Fatal error: Unsupported operand types in /usr/www/users/dpedia/drupal5/sites/all/modules/yahoo_terms/yahoo_terms.module on line 123
The path that generates this error message is:
leech/refresh/45?destination=leech/feed
The code that generates this error is as follows (beginning with line 118):
$tids = _yahoo_terms_create_vocabulary_items($terms, $vid, $static);
$tids_in_node = array_keys($node->taxonomy);
$tids_fetched = array_keys($tids);
// Union of these arrays
$tids_now = $tids_in_node + $tids_fetched;
taxonomy_node_save($node->nid, $tids_now);
I checked the variable table in my database, and it has a value of "4" (the numeric ID for my "keywords" vocabulary) for yahoo_terms_vocab, yahoo_terms_vocab_for_rssfeed (rssfeed is the content type for my feed items) and yahoo_terms_vocab_for_rsssource (the content type for my feed sources). I inserted a line into the module just above the lines above to set $vid = 4, and the error message disappeared. It appears, therefore, that the $vid is not getting passed into this function properly. I believe the place where this is happening is line 2364 of the leech module, which reads,
node_invoke_nodeapi($edit, "terms_tagging", $vid, $query);
If I add a "$vid=4" just above the node_invoke_nodeapi command, the fatal error disappears, but some other strange things are happening. When I click on "retrieve feed items" for one of my feed sources, items get loaded and nodes get created, but the items don't show up when I click "view feed items." However, they do show up as items under taxonomy/term/1, which is strange, because taxonomy/term/1 is a term in my "topics" vocabulary, not the "keywords" vocabulary which I am trying to use with leech/yahoo_terms.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | yahooterms5.patch | 983 bytes | designerbrent |
Comments
Comment #1
marcoBauli commentedGetting the same error, but when posting any content type (page, story, CCK) different from the Leech template type (I installed Yahoo_terms to be used with Leech actually)..pretty critical, as no other contents can be posted to the site..
Drupal 5.3 and latest Yahoo_terms here. Thx
Comment #2
mdekkers commentedSame here....
Comment #3
designerbrent commentedThis seems to fix the problem. I haven't tested it on the 5.x version, only on the patch I am working on for drupal 6.
I was able to reproduce the bug when creating new nodes. It seems that the $node->taxonomy was null and that was causing the error when it was trying to join with the $tids_fetched to create $tids_now.
This patch checks if $node->taxonomy is null and if so, then works without it.
Comment #4
Shiny commentedPatch makes sense. Added to drupal-5 branch in cvs.