From: Michael Date: Sat, 29 Jun 2019 08:30:48 +0000 (+0000) Subject: Item delivery data must only be stored when there is data X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3121d967c561d25ecaff40478233fc974b309e90;p=friendica.git Item delivery data must only be stored when there is data --- diff --git a/config/dbstructure.config.php b/config/dbstructure.config.php index 5c6948a62f..5cf9d85972 100755 --- a/config/dbstructure.config.php +++ b/config/dbstructure.config.php @@ -34,7 +34,7 @@ use Friendica\Database\DBA; if (!defined('DB_UPDATE_VERSION')) { - define('DB_UPDATE_VERSION', 1314); + define('DB_UPDATE_VERSION', 1315); } return [ diff --git a/src/Model/Item.php b/src/Model/Item.php index 3c503dd670..3244053ba0 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -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(); diff --git a/update.php b/update.php index 077a56e66e..aead1b93de 100644 --- a/update.php +++ b/update.php @@ -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]); +}