]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
bug fix: bug when inserting a relation already into the base
authorericdane <ericdane@b3834d28-1941-0410-a4f8-b48e95affb8f>
Fri, 8 Feb 2008 09:21:26 +0000 (09:21 +0000)
committerericdane <ericdane@b3834d28-1941-0410-a4f8-b48e95affb8f>
Fri, 8 Feb 2008 09:21:26 +0000 (09:21 +0000)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@35 b3834d28-1941-0410-a4f8-b48e95affb8f

services/tag2tagservice.php
tests/tag2TagTest.php

index 1c6392eda7d20c3a4a2cfb9284f6632e7aad6759..d3a4a779bd954ee6a3f57a3d49e60edc38cec862 100644 (file)
@@ -17,7 +17,8 @@ class Tag2TagService {
 
     function addLinkedTags($tag1, $tag2, $relationType, $uId) {
        if($tag1 == $tag2 || strlen($tag1) == 0 || strlen($tag2) == 0
-               || ($relationType != ">" && $relationType != "=")) {
+               || ($relationType != ">" && $relationType != "=")
+               || ($this->existsLinkedTags($tag1, $tag2, $relationType, $uId))) {
                return false;
        }
        $values = array('tag1' => $tag1, 'tag2' => $tag2, 'relationType'=> $relationType, 'uId'=> $uId);
index f54537c2ba8e0dad45edacb5fa51077c237fcb1f..87dde52a32807611615ef3907f52a79e9f081d45 100644 (file)
@@ -264,6 +264,8 @@ class Tag2TagTest extends PHPUnit_Framework_TestCase
        $tts = $this->tts;
        $bs = $this->bs;
 
+       $tts->addLinkedTags('aa', 'bb', '>', 1);        
+
        $tags = array('aa>bb>cc', 'dd');
        $bs->addBookmark("web1.com", "B1", "description", "status", $tags, null, false, false, 1);
        $tags = array('bb>gg', 'ee>ff');