aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2019-04-04 11:00:19 +0200
committerMax Kostikov <max@kostikov.co>2019-04-04 11:00:19 +0200
commit0c2db1cea593ea0f59d1cd3c918a5bccaf90c4c5 (patch)
treebc8a0d036a1bed377ed2e2fcf937dc53f251eb13
parente33604887bfc2671d933f425215d8c264dcbcab9 (diff)
downloadvolse-hubzilla-0c2db1cea593ea0f59d1cd3c918a5bccaf90c4c5.tar.gz
volse-hubzilla-0c2db1cea593ea0f59d1cd3c918a5bccaf90c4c5.tar.bz2
volse-hubzilla-0c2db1cea593ea0f59d1cd3c918a5bccaf90c4c5.zip
Skip removal if no cover image found
-rw-r--r--Zotlabs/Module/Cover_photo.php13
1 files changed, 7 insertions, 6 deletions
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');
}