From 85c363a79ec563307968394896dee67428f53fad Mon Sep 17 00:00:00 2001 From: nathangray Date: Wed, 7 Feb 2018 11:02:50 -0700 Subject: [PATCH] * Calendar - Allow templates without pagerepeat or range tags to work using only the first ID --- calendar/inc/class.calendar_merge.inc.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/calendar/inc/class.calendar_merge.inc.php b/calendar/inc/class.calendar_merge.inc.php index 1b64c5677d..69f8031ee7 100644 --- a/calendar/inc/class.calendar_merge.inc.php +++ b/calendar/inc/class.calendar_merge.inc.php @@ -585,7 +585,8 @@ class calendar_merge extends Api\Storage\Merge * Validate and properly format a list of 'ID's into either a list of ranges * or a list of IDs, depending on what the template needs. Templates using * the range placeholder need a list of date ranges, templates using pagerepeat - * need a list of individual events. + * need a list of individual events. Templates using neither get just the + * first ID * * @param Array[]|String[] $ids List of IDs, which can be a list of individual * event IDs, entire events, a date range (start & end) or a list of date ranges. @@ -638,6 +639,10 @@ class calendar_merge extends Api\Storage\Merge } } } + else + { + $validated_ids[] = $this->normalize_event_id(array_shift($ids)); + } return $validated_ids; }