From fd1e5b63deaad622784edfbfad6cf0831cabab6e Mon Sep 17 00:00:00 2001 From: Thor Brink Date: Tue, 27 Feb 2024 07:35:49 +0000 Subject: [PATCH 1/2] fix: missing event view path --- source/php/App.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/source/php/App.php b/source/php/App.php index 5cfbdf46..3a8b6cdb 100755 --- a/source/php/App.php +++ b/source/php/App.php @@ -52,6 +52,23 @@ public function __construct() add_action('widgets_init', function () { register_widget('EventManagerIntegration\Widget\DisplayEvents'); }); + + // Add view paths + add_action('template_redirect', function () { + if (get_post_type() === 'event') { + add_filter('Municipio/viewPaths', array($this, 'addViewPaths'), 2, 1); + } + }, 10); + } + + /** + * Add searchable blade template paths + * @param array $array Template paths + * @return array Modified template paths + */ + public function addViewPaths($array) + { + return array_merge( [EVENTMANAGERINTEGRATION_VIEW_PATH], $array ); } /** From b1922bf7e545a92bb1bb04a0d3d15907702311fc Mon Sep 17 00:00:00 2001 From: Thor Brink Date: Tue, 27 Feb 2024 07:37:01 +0000 Subject: [PATCH 2/2] fix: passing null to in_array --- source/php/PostTypes/Events.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/php/PostTypes/Events.php b/source/php/PostTypes/Events.php index ac5dd037..1c2106c0 100755 --- a/source/php/PostTypes/Events.php +++ b/source/php/PostTypes/Events.php @@ -209,7 +209,7 @@ public function singleViewData($data) ]; $data['eventLang'] = (object) array( - 'accessibilityLabels' => array_filter($accessibilityLabels, fn($key) => in_array($key, $locationInfo['accessibility']), ARRAY_FILTER_USE_KEY), + 'accessibilityLabels' => array_filter($accessibilityLabels, fn($key) => in_array($key, $locationInfo['accessibility'] ?? []), ARRAY_FILTER_USE_KEY), 'link' => __('Event link', 'event-integration'), 'ticket' => __('Ticket', 'event-integration'), 'goToEventWebsite' => __('Go to event website', 'event-integration'),