Merge pull request #7328 from annando/fix-delivery

Item delivery data must only be stored when there is data
This commit is contained in:
Hypolite Petovan 2019-06-29 05:01:29 -04:00 committed by GitHub
commit 541593fd4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 2 deletions

View file

@ -34,7 +34,7 @@
use Friendica\Database\DBA;
if (!defined('DB_UPDATE_VERSION')) {
define('DB_UPDATE_VERSION', 1314);
define('DB_UPDATE_VERSION', 1315);
}
return [

View 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();

View 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]);
}