Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix put_mapping check and return filtered value #2642

Merged
merged 1 commit into from
Mar 8, 2022
Merged
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
8 changes: 2 additions & 6 deletions includes/classes/IndexHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ protected function output_index_errors( $failed_objects ) {
* @return boolean
*/
public function is_full_reindexing( $indexable_slug, $blog_id = null ) {
if ( empty( $this->index_meta ) ) {
if ( empty( $this->index_meta ) || empty( $this->index_meta['put_mapping'] ) ) {
/**
* Filter if a fully reindex is being done to an indexable
*
Expand All @@ -976,10 +976,6 @@ public function is_full_reindexing( $indexable_slug, $blog_id = null ) {
continue;
}

if ( empty( $sync_item['put_mapping'] ) ) {
break;
}

if (
( empty( $sync_item['blog_id'] ) && ! $blog_id ) ||
(int) $sync_item['blog_id'] === $blog_id
Expand All @@ -989,7 +985,7 @@ public function is_full_reindexing( $indexable_slug, $blog_id = null ) {
}

/* this filter is documented above */
apply_filters( "ep_is_full_reindexing_{$indexable_slug}", $is_full_reindexing );
return apply_filters( "ep_is_full_reindexing_{$indexable_slug}", $is_full_reindexing );
}

/**
Expand Down