Nodewords attempts to reference array elements that are not defined, simple check to make sure they're defined before calling the function.

Index: nodewords.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/nodewords/Attic/nodewords.module,v
retrieving revision 1.57.2.6
diff -u -p -r1.57.2.6 nodewords.module
--- nodewords.module 15 Feb 2008 14:16:56 -0000 1.57.2.6
+++ nodewords.module 16 Dec 2008 15:16:07 -0000
@@ -460,7 +460,7 @@ function _nodewords_form($type, $tags) {
 
   foreach (_nodewords_get_possible_tags() as $tag) {
     $function = 'nodewords_'. $tag .'_form';
-    if ($settings['edit'][$tag] && function_exists($function)) {
+    if ($settings['edit'][$tag] && function_exists($function) && array_key_exists($tag, $tags)) {
       $element = $function($type, $tags[$tag], $settings);
       if ($element) {
         $form[$tag] = $element;

Comments

pletcher’s picture

Wups, that removes both the notices and the metadata form. The corrected code is below, sorry.

Index: nodewords.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/nodewords/Attic/nodewords.module,v
retrieving revision 1.57.2.6
diff -u -p -r1.57.2.6 nodewords.module
--- nodewords.module 15 Feb 2008 14:16:56 -0000 1.57.2.6
+++ nodewords.module 16 Dec 2008 15:48:31 -0000
@@ -461,6 +461,9 @@ function _nodewords_form($type, $tags) {
   foreach (_nodewords_get_possible_tags() as $tag) {
     $function = 'nodewords_'. $tag .'_form';
     if ($settings['edit'][$tag] && function_exists($function)) {
+      if (!array_key_exists($tag, $tags)) {
+        $tags[$tag] = NULL;
+      }
       $element = $function($type, $tags[$tag], $settings);
       if ($element) {
         $form[$tag] = $element;
Robrecht Jacques’s picture

Status: Active » Fixed

Comitted to CVS. Thanks!

Status: Fixed » Closed (fixed)

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