Skip to content

Commit

Permalink
Merge branch 'TMS-977' into stage
Browse files Browse the repository at this point in the history
  • Loading branch information
eebbi committed Jan 11, 2024
2 parents 489a945 + 1e4fce3 commit ca79952
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Models/page-combined-events-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ protected function get_events() : array {
$end_date = \get_query_var( self::EVENT_SEARCH_END_DATE );
$end_date = ! empty( $end_date ) ? $end_date : date( 'Y-m-d', strtotime( '+1 year' ) );

if ( ! $event_search_text && ! \get_query_var( self::EVENT_SEARCH_START_DATE ) && ! \get_query_var( self::EVENT_SEARCH_END_DATE ) ) {
return [];
}

$paged = \get_query_var( 'paged', 1 );
$skip = 0;

Expand Down Expand Up @@ -141,7 +145,7 @@ protected function get_events() : array {

if ( empty( $response ) ) {
$response = $this->do_get_events( $params );
$response['events'] = array_merge( $response['events'], $this->get_manual_events( $params ) );
$response['events'] = array_merge( $response['events'] ?? [], $this->get_manual_events( $params ) );

// Sort events by start datetime objects.
usort( $response['events'], function( $a, $b ) {
Expand Down

0 comments on commit ca79952

Please sign in to comment.