]> git.mxchange.org Git - friendica.git/commitdiff
Avoid a possible foreign key constraint
authorMichael <heluecht@pirati.ca>
Tue, 16 Feb 2021 08:00:23 +0000 (08:00 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 16 Feb 2021 08:00:23 +0000 (08:00 +0000)
include/enotify.php

index 8936cadbe4c3eb666cff303420c2593f3d50facf..e56b563e3e5c60c3843864b09570cb80532d4e1c 100644 (file)
@@ -521,11 +521,10 @@ function notification($params)
                        $message_id = "<" . $parent['guid'] . "@" . gethostname() . ">";
 
                        // Is this the first email notification for this parent item and user?
-                       if (!DBA::exists('notify-threads', ['master-parent-item' => $params['parent'], 'receiver-uid' => $params['uid']])) {
+                       if (!DBA::exists('notify-threads', ['master-parent-uri-id' => $parent_uri_id, 'receiver-uid' => $params['uid']])) {
                                Logger::log("notify_id:" . intval($notify_id) . ", parent: " . intval($params['parent']) . "uid: " . intval($params['uid']), Logger::DEBUG);
 
-                               $fields = ['notify-id' => $notify_id, 'master-parent-item' => $params['parent'],
-                                       'master-parent-uri-id' => $parent_uri_id,
+                               $fields = ['notify-id' => $notify_id, 'master-parent-uri-id' => $parent_uri_id,
                                        'receiver-uid' => $params['uid'], 'parent-item' => 0];
                                DBA::insert('notify-threads', $fields);