There's a mistake at line 1206 in nodewords.module that prevents nodewords such as keywords to appear in the HTML.
"count($result) > 2" should be "count($result) >= 2" or even "count($result) == 2".

Comments

avpaderno’s picture

Title: Missing nodewords » Meta tags don't appear because a bug in the function that detects the page being viewed
Priority: Critical » Normal
Status: Active » Fixed

The problem does not allow the correct meta tags to appear in the page in most the cases.
Probably, the default values were used, and in the case the default value was empty (as reported by empty()), the meta tag was not shown in the HTML output.

Thanks for your report, and the help in finding the solution to the issue.

maximpodorov’s picture

The latest dev version still doesn't work. Here's the solution:

--- nodewords.module.orig 2009-11-20 14:15:00.000000000 +0300
+++ nodewords.module 2009-11-20 15:38:57.000000000 +0300
@@ -455,7 +455,8 @@
* Implementation of hook_preprocess_page().
*/
function nodewords_preprocess_page(&$variables) {
- $parameters = _nodewords_detect_type_and_ids();
+ $parameters = array();
+ list($parameters['type'], $parameters['ids']) = _nodewords_detect_type_and_ids();
$tags = nodewords_get_tags($parameters['type'], $parameters['ids']);

$output = nodewords_output_tags($tags);
@@ -1205,7 +1206,7 @@
}

if (drupal_is_front_page() && variable_get('nodewords_use_frontpage_tags', TRUE)) {
- return array(NODEWORDS_TYPE_FRONTPAGE, 0);
+ return array(NODEWORDS_TYPE_FRONTPAGE, '');
}

if (!isset($arg[0])) {

avpaderno’s picture

I have changed the code, and committed it to CVS.

Thanks for the help.

maximpodorov’s picture

And this part fixes nodewords showing on the front page:

@@ -1205,7 +1206,7 @@
}

if (drupal_is_front_page() && variable_get('nodewords_use_frontpage_tags', TRUE)) {
- return array(NODEWORDS_TYPE_FRONTPAGE, 0);
+ return array(NODEWORDS_TYPE_FRONTPAGE, '');
}

avpaderno’s picture

Thanks again for your help!

I changed the code, and committed it in CVS.

Status: Fixed » Closed (fixed)

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