In Drupal 6, taxonomy_node_get_terms() no longer takes a node id as argument but a full $node object.
See http://drupal.org/node/114774#taxonomy-revisions
The following code in 6.x-1.0-rc1 keywords.inc is obviously incorrect and causes taxonomy terms to not generate keywords:
function nodewords_keywords_prepare($type, $ids, $value, $settings) {
if ($type == 'node' && function_exists('taxonomy_node_get_terms') && count($ids) == 1) {
if (node_access('view', node_load($ids[0]))) {
foreach (taxonomy_node_get_terms($ids[0]) as $term) {
This should probably be something like:
function nodewords_keywords_prepare($type, $ids, $value, $settings) {
if ($type == 'node' && function_exists('taxonomy_node_get_terms') && count($ids) == 1) {
$n = node_load($ids[0]);
if (node_access('view', $n)) {
foreach (taxonomy_node_get_terms($n) as $term) {
A patch that works for me is attached
Steffen
Comments
Comment #1
Rob T commentedI made this modification, and the taxonomy keyword feature is working so far.
Comment #2
jcfiala commentedI've made the same modification, and the taxonomy keyword seems to work fine now. Included is a patch, as I don't see one attached to the ticket yet.
Comment #3
vladimir.dolgopolov commentedThe patch works well.
Just rerolled the pach ($n -> $node and some cleanup)
Comment #4
Arshad Vayani commentedthere is one more problem, keywords looks like fun,humour,drupal but there should be space between them like fun, humour, drupal like that! any fix for it?
Comment #5
Arshad Vayani commentedokay i just fixed it with the help of a forum member
here is the code
i just added space in three lines :D
Comment #6
jrglasgow commentedthis patch (nodewords270193.patch) works great for me
Comment #7
netentropy commentedhow do i apply this patch?
what do the + and - mean by each line?
Comment #8
Arshad Vayani commented- means to removes those lines and + means to add those lines ;)
Comment #9
jrglasgow commentedthe other option would be to copy the patch file to the module directory and from the command line type
this should apply the patch
Comment #10
Arshad Vayani commentedlol i didnt knew that ^^ thanks ;)
Comment #11
marcob commentedThis patch works for me.
Thanks
Comment #12
wildtang3nt commentedPatch works fine, awaiting inclusion into Nodewords proper.
Comment #13
podarokThanks a lot
This patch works for me
What about including it into release?
If You have no time - I can do it (just add me to developers)
---------
Andriy Podanenko
web: http://my.ukrweb.info
Comment #14
summit commentedHi Robert,
Will this patch go in D6 please?
Thanks a lot in advance for considering this!
Greetings.
Martijn
Comment #15
Robrecht Jacques commentedCommitted as part of http://drupal.org/node/340642.
Will be included in next releasE. Thanks!
Comment #17
shaneonabike commentedStrange. It seems like there is actually a problem again in the latest release. In debugging the code custom pages are actually generating the proper keywords associated with a node but they aren't actually being output. I tried to look through the code but can't seem to figure out what is wrong....
Ideas? I could really use this functionality and would be willing to help contribute I'm getting a bit confused with the difference of obtaining the keywords and rendering in the nodewords code.
Comment #18
shaneonabike commentedActually I noticed that the keywords don't actually 'automagically' add themselves to each node. But rather if you add the [metatags-taxonomy-keywords] token to each custom page keyword section then they do add themselves properly. Is that the intended behavior?
Comment #19
Anonymous (not verified) commentedYes, it is.
Comment #20
shaneonabike commentedOkay that's totally cool but maybe change the wording of the Defaults page from:
to:
Comment #21
Anonymous (not verified) commentedI changed the description to .