]> git.mxchange.org Git - friendica.git/commitdiff
Item delivery data must only be stored when there is data
authorMichael <heluecht@pirati.ca>
Sat, 29 Jun 2019 08:30:48 +0000 (08:30 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 29 Jun 2019 08:30:48 +0000 (08:30 +0000)
config/dbstructure.config.php
src/Model/Item.php
update.php

index 5c6948a62f751451f4ade3672114a888f02c23ef..5cf9d85972a4b84293ce4dd33cba157eb1d78170 100755 (executable)
@@ -34,7 +34,7 @@
 use Friendica\Database\DBA;
 
 if (!defined('DB_UPDATE_VERSION')) {
-       define('DB_UPDATE_VERSION', 1314);
+       define('DB_UPDATE_VERSION', 1315);
 }
 
 return [
index 3c503dd670c454f40870bddf60a3471e5e779ce1..3244053ba0b4d8193b1b6f98fe66a9a2d4f80536 100644 (file)
@@ -1883,7 +1883,9 @@ class Item extends BaseObject
                        self::updateThread($parent_id);
                }
 
-               ItemDeliveryData::insert($current_post, $delivery_data);
+               if (!empty($item['origin']) || !empty($item['wall']) || !empty($delivery_data['postopts']) || !empty($delivery_data['inform'])) {
+                       ItemDeliveryData::insert($current_post, $delivery_data);
+               }
 
                DBA::commit();
 
index 077a56e66e795252e8027ab6b1f73caa1ad338f3..aead1b93de68455c97b93d9abbf482cb8093c2ab 100644 (file)
@@ -369,3 +369,8 @@ function update_1309()
        }
        return Update::SUCCESS;
 }
+
+function update_1315()
+{
+       DBA::delete('item-delivery-data', ['postopts' => '', 'inform' => '', 'queue_count' => 0, 'queue_done' => 0]);
+}