]> git.mxchange.org Git - friendica.git/commitdiff
We should return a return value when we say that we have a return value.
authorMichael <heluecht@pirati.ca>
Fri, 28 Apr 2017 06:21:12 +0000 (06:21 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 28 Apr 2017 06:21:12 +0000 (06:21 +0000)
include/dba.php
include/items.php

index 93df40b401c8b9e2f93da6116718a18fafacb847..3f4d814821da9b8f88b962b55bacac1d391cb82c 100644 (file)
@@ -776,7 +776,7 @@ class dba {
                        $params[] = $value;
                }
 
-               self::e($sql, $params);
+               return self::e($sql, $params);
        }
 
        /**
index 98b40f1eeb889c836455595272a6014520c4e8e4..285a5745aad22791a0e7ce9a20822c17e9c055d3 100644 (file)
@@ -719,11 +719,15 @@ function item_store($arr, $force_parent = false, $notify = false, $dontcache = f
                $conv = dba::fetch_first("SELECT `protocol` FROM `conversation` WHERE `item-uri` = ?", $conversation['item-uri']);
                if (dbm::is_result($conv)) {
                        // Replace the conversation entry when the new one is better
-                       if (($conv['protocol'] == 0) OR ($conv['protocol'] > $conversation['protocol'])) {
-                               dba::update('conversation', $conversation, array('item-uri' => $conversation['item-uri']));
+                       if ((($conv['protocol'] == 0) OR ($conv['protocol'] > $conversation['protocol'])) AND ($conversation['protocol'] > 0)) {
+                               if (!dba::update('conversation', $conversation, array('item-uri' => $conversation['item-uri']))) {
+                                       logger('Conversation: update for '.$conversation['item-uri'].' from '.$conv['protocol'].' to '.$conversation['protocol'].' failed', LOGGER_DEBUG);
+                               }
                        }
                } else {
-                       dba::insert('conversation', $conversation);
+                       if (!dba::insert('conversation', $conversation)) {
+                               logger('Conversation: insert for '.$conversation['item-uri'].' (protocol '.$conversation['protocol'].') failed', LOGGER_DEBUG);
+                       }
                }
        }