Skip to content

Commit

Permalink
Merge branch 'develop' into release/4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
felipeelia authored Mar 8, 2022
2 parents 0c02f3c + a5ebfe9 commit 180c599
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
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
16 changes: 15 additions & 1 deletion includes/partials/stats-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@

if ( defined( 'EP_IS_NETWORK' ) && EP_IS_NETWORK ) {
$index_meta = get_site_option( 'ep_index_meta', false );
$sync_url = network_admin_url( 'admin.php?page=elasticpress-sync' );
} else {
$index_meta = get_option( 'ep_index_meta', false );
$sync_url = admin_url( 'admin.php?page=elasticpress-sync' );
}

Stats::factory()->build_stats();
Expand Down Expand Up @@ -86,6 +88,18 @@
</div>
</div>
<?php else : ?>
<p><?php echo wp_kses( __( 'We could not find any data for your Elasticsearch indices. Maybe you need to <a href="admin.php?page=elasticpress">sync your content</a>?', 'elasticpress' ), 'ep-html' ); ?></p>
<p>
<?php
printf(
/* translators: %s: Sync page link. */
esc_html__( 'We could not find any data for your Elasticsearch indices. Maybe you need to %s?', 'elasticpress' ),
sprintf(
'<a href="%1$s">%2$s</a>',
esc_url( $sync_url ),
esc_html__( 'sync your content', 'elasticpress' )
)
);
?>
</p>
<?php endif; ?>
</div>

0 comments on commit 180c599

Please sign in to comment.