Shouldn’t Attendees_Table.php->prepare_items() cache have $search in key?
-
Something changed on my server that is leading to Event->Attendees returning the same results regardless of query for 60 seconds, and I’ve been unable to track it down, but I think it might have exposed a bug.
In /src/Tribe/Attendess_Table.php starting at line 1049, it reads:
$args = [
'page' => $current_page,
'per_page' => $per_page,
'return_total_found' => true,
'order' => 'DESC',
];
$event_id = Event::filter_event_id( filter_var( tribe_get_request_var( 'event_id' ), FILTER_VALIDATE_INT ), 'attendees-table' );
$search = sanitize_text_field( tribe_get_request_var( $this->search_box_input_name ) );
if ( empty( $event_id ) ) {
$event_id = 0;
}
/** @var Tribe__Cache $cache */
$cache = tribe( 'cache' );
$cache_key = __METHOD__ . '-' . md5( wp_json_encode( $args ) . $event_id );
$cached = $cache->get( $cache_key );
if ( $cached ) {
$this->items = $cached;
return $cached;
}Shouldn’t $cache_key include $search? I’m not sure why this only just started happening for me at the end of August (I’m suspecting something changed on the host), but shouldn’t:
$cache_key = __METHOD__ . ‘-‘ . md5( wp_json_encode( $args ) . $event_id );
read something like:
$cache_key = __METHOD__ . ‘-‘ . md5( wp_json_encode( $args ) . $event_id . $search );
?Sorry if I’m wrong here.
- You must be logged in to reply to this topic.