diff options
author | 2024-06-11 00:13:48 -0700 | |
---|---|---|
committer | 2024-06-11 00:13:48 -0700 | |
commit | a959a69a1dd781caa33829db161859c88455911d (patch) | |
tree | ac0db2fa23482c6ef5caedd21079bf2f8c9be368 /src/SemanticScuttle/Service/Tag2Tag.php | |
parent | 9bcc5827388491d37591a86a175f63fa9cd38d41 (diff) | |
parent | 85cca718e308779a56dbf302140ce9088fc0727a (diff) | |
download | scuttle-a959a69a1dd781caa33829db161859c88455911d.tar.gz scuttle-a959a69a1dd781caa33829db161859c88455911d.zip |
Merge branch 'sqlite-fixes' into oni
Diffstat (limited to 'src/SemanticScuttle/Service/Tag2Tag.php')
-rw-r--r-- | src/SemanticScuttle/Service/Tag2Tag.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/SemanticScuttle/Service/Tag2Tag.php b/src/SemanticScuttle/Service/Tag2Tag.php index 9dddc44..d404bb5 100644 --- a/src/SemanticScuttle/Service/Tag2Tag.php +++ b/src/SemanticScuttle/Service/Tag2Tag.php @@ -94,7 +94,15 @@ class SemanticScuttle_Service_Tag2Tag extends SemanticScuttle_DbService ); return false; } - $this->db->sql_transaction('commit'); + + if (!$this->db->sql_transaction('commit')) { + $this->db->sql_transaction('rollback'); + message_die( + GENERAL_ERROR, 'Could not commit attaching tag to tag', + '', __LINE__, __FILE__, $query, $this->db + ); + return false; + } // Update stats and cache $this->update($tag1, $tag2, $relationType, $uId); @@ -270,7 +278,7 @@ class SemanticScuttle_Service_Tag2Tag extends SemanticScuttle_DbService $tsts =SemanticScuttle_Service_Factory::get('TagStat'); $query.= ", ".$tsts->getTableName() ." tsts"; } - $query.= " WHERE tts.tag1 <> ALL"; + $query.= " WHERE tts.tag1 not in"; $query.= " (SELECT DISTINCT tag2 FROM `". $this->getTableName() ."`"; $query.= " WHERE relationType = '" . $this->db->sql_escape($relationType) . "'"; if($uId > 0) { |