From 94065fde33f500691cd7fc118cfeef4ea4ca22da Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 2 Nov 2016 19:26:02 -0700 Subject: issue #576 - duplicate events shown --- Zotlabs/Module/Cal.php | 2 +- Zotlabs/Module/Events.php | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Cal.php b/Zotlabs/Module/Cal.php index 0d1641efe..d03e2e951 100644 --- a/Zotlabs/Module/Cal.php +++ b/Zotlabs/Module/Cal.php @@ -224,7 +224,7 @@ class Cal extends \Zotlabs\Web\Controller { $r = q("SELECT event.*, item.plink, item.item_flags, item.author_xchan, item.owner_xchan from event left join item on event_hash = resource_id - where resource_type = 'event' and event.uid = %d $ignored + where resource_type = 'event' and event.uid = %d and event.uid = item.uid $ignored AND (( adjust = 0 AND ( dtend >= '%s' or nofinish = 1 ) AND dtstart <= '%s' ) OR ( adjust = 1 AND ( dtend >= '%s' or nofinish = 1 ) AND dtstart <= '%s' )) $sql_extra ", intval($channel['channel_id']), diff --git a/Zotlabs/Module/Events.php b/Zotlabs/Module/Events.php index c1c475636..b8910b644 100644 --- a/Zotlabs/Module/Events.php +++ b/Zotlabs/Module/Events.php @@ -559,10 +559,10 @@ class Events extends \Zotlabs\Web\Controller { // There's still an issue if the finish date crosses the end of month. // Noting this for now - it will need to be fixed here and in Friendica. // Ultimately the finish date shouldn't be involved in the query. - + $r = q("SELECT event.*, item.plink, item.item_flags, item.author_xchan, item.owner_xchan from event left join item on event_hash = resource_id - where resource_type = 'event' and event.uid = %d $ignored + where resource_type = 'event' and event.uid = %d and event.uid = item.uid $ignored AND (( adjust = 0 AND ( dtend >= '%s' or nofinish = 1 ) AND dtstart <= '%s' ) OR ( adjust = 1 AND ( dtend >= '%s' or nofinish = 1 ) AND dtstart <= '%s' )) ", intval(local_channel()), @@ -571,7 +571,6 @@ class Events extends \Zotlabs\Web\Controller { dbesc($adjust_start), dbesc($adjust_finish) ); - } $links = array(); -- cgit v1.2.3