From 0c2db1cea593ea0f59d1cd3c918a5bccaf90c4c5 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 4 Apr 2019 11:00:19 +0200 Subject: Skip removal if no cover image found --- Zotlabs/Module/Cover_photo.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Cover_photo.php b/Zotlabs/Module/Cover_photo.php index 89bfcc281..b67c00cdc 100644 --- a/Zotlabs/Module/Cover_photo.php +++ b/Zotlabs/Module/Cover_photo.php @@ -56,18 +56,19 @@ class Cover_photo extends \Zotlabs\Web\Controller { intval(PHOTO_COVER), intval(local_channel()) ); - - q("update photo set photo_usage = %d where photo_usage = %d and uid = %d", - intval(PHOTO_NORMAL), - intval(PHOTO_COVER), - intval(local_channel()) - ); if($r) { + q("update photo set photo_usage = %d where photo_usage = %d and uid = %d", + intval(PHOTO_NORMAL), + intval(PHOTO_COVER), + intval(local_channel()) + ); + $sync = attach_export_data($channel,$r[0]['resource_id']); if($sync) build_sync_packet($channel['channel_id'],array('file' => array($sync))); } + goaway(z_root() . '/cover_photo'); } -- cgit v1.2.3