Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions assets/js/dist/admin.bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion assets/js/dist/admin.bundle.js.LICENSE.txt

This file was deleted.

2 changes: 0 additions & 2 deletions assets/js/dist/public.bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion assets/js/dist/public.bundle.js.LICENSE.txt

This file was deleted.

4 changes: 2 additions & 2 deletions assets/js/src/components/admin/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ const Settings = () => {
<strong>{source.name || source.url}</strong>
<div className="mayo-external-source-details">
<span className="mayo-source-id">ID: {source.id}</span>
{source.event_type && <span>Type: {source.event_type}</span>}
<span>Type: {source.event_type || 'All'}</span>
{source.service_body && <span>Service Body: {source.service_body}</span>}
<span className={`mayo-source-status ${source.enabled ? 'enabled' : 'disabled'}`}>
{source.enabled ? 'Enabled' : 'Disabled'}
Expand Down Expand Up @@ -484,7 +484,7 @@ const Settings = () => {
label="Event Type"
value={currentSource.event_type || ''}
options={[
{ label: 'Select an event type', value: '' },
{ label: 'All Event Types', value: '' },
{ label: 'Activity', value: 'Activity' },
{ label: 'Service', value: 'Service' }
]}
Expand Down
38 changes: 28 additions & 10 deletions includes/Rest/EventsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -862,11 +862,20 @@ private static function get_local_events($params) {
];

if (!empty($eventType)) {
$recurring_meta_query[] = [
'key' => 'event_type',
'value' => $eventType,
'compare' => '='
];
if (str_contains($eventType, ',')) {
$event_types = array_map('trim', explode(',', $eventType));
$recurring_meta_query[] = [
'key' => 'event_type',
'value' => $event_types,
'compare' => 'IN'
];
} else {
$recurring_meta_query[] = [
'key' => 'event_type',
'value' => $eventType,
'compare' => '='
];
}
}

if (!empty($serviceBody)) {
Expand Down Expand Up @@ -1024,11 +1033,20 @@ private static function query_events($status, $eventType, $serviceBody, $relatio
$meta_query = [];

if (!empty($eventType)) {
$meta_query[] = [
'key' => 'event_type',
'value' => $eventType,
'compare' => '='
];
if (str_contains($eventType, ',')) {
$event_types = array_map('trim', explode(',', $eventType));
$meta_query[] = [
'key' => 'event_type',
'value' => $event_types,
'compare' => 'IN'
];
} else {
$meta_query[] = [
'key' => 'event_type',
'value' => $eventType,
'compare' => '='
];
}
}

if (!empty($serviceBody)) {
Expand Down
2 changes: 2 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ This project is licensed under the GPL v2 or later.
= 1.8.8 =
* Added diagnostic timing instrumentation to the events API for debugging slow external source requests. Append `&debug=1` to see per-call timing breakdown.
* Improved performance of external source fetching by parallelizing HTTP requests. Sites with multiple external sources will see significantly faster load times.
* Changed external source event type dropdown from "Select an event type" to "All Event Types" to clarify that leaving it blank fetches all types.
* Added support for comma-separated event types in the REST API (e.g., `event_type=Activity,Service`), enabling a single external source to fetch multiple event types in one request.

= 1.8.7 =
* Fixed announcement form flyer upload field never appearing even when `show_flyer="true"` shortcode attribute was set. [#252]
Expand Down