From 20de7a5cb7ba525f1cfba48221ed0922d670e426 Mon Sep 17 00:00:00 2001
From: rmjiv <git@379535.no-reply.drupal.org>
Date: Fri, 25 Feb 2011 02:07:03 +0000
Subject: [PATCH] #357331 by rmjiv: duplicate key warnings on node_save()

---
 primary_term.module |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/primary_term.module b/primary_term.module
index c96c30a..44487fa 100644
--- a/primary_term.module
+++ b/primary_term.module
@@ -43,7 +43,7 @@ function primary_term_nodeapi(&$node, $op, $teaser, $page) {
           if (is_object($v) && $v->tid == $tid) {
             return;
           } 
-          elseif (is_array($v) && !empty($v[$tid])) {
+          elseif (is_array($v) && (!empty($v[$tid]) || (in_array($tid,$v))) ) {
             return;
           }
           elseif (is_numeric($v) && $v == $tid) {
-- 
1.7.5.4

