Item delivery data must only be stored when there is data

This commit is contained in:
Michael 2019-06-29 08:30:48 +00:00
parent c5d8d82bd2
commit 3121d967c5
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);
}
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]);
}