وردپرس

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.

این خبر را در ایران وب سازان مرجع وب و فناوری دنبال کنید

مشاهده پاسخ های این مطلب
———————————————
این مطلب از سایت انجمن وردپرس گردآوری شده است و کلیه حقوق مطلق به انجمن وردپرس می باشد در صورت مغایرت و یا بروز مشکل اطلاع دهید تا حذف گردد

منبع: انجمن وردپرس

دکمه بازگشت به بالا