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

Feature implementation for #1471 #1472

Merged
merged 18 commits into from
Aug 9, 2021
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix notice
  • Loading branch information
tott committed Aug 29, 2019
commit 845d7ff5d979d8b7ffc3de18c93eed200310ff7b
16 changes: 13 additions & 3 deletions includes/classes/AdminNotices.php
Original file line number Diff line number Diff line change
Expand Up @@ -584,24 +584,34 @@ protected function process_host_error_notice() {
* @return array|bool
*/
protected function process_maybe_wrong_mapping_notice() {
// we might have this dismissed
if ( defined( 'EP_IS_NETWORK' ) && EP_IS_NETWORK ) {
$dismiss = get_site_option( 'ep_hide_maybe_wrong_mapping_notice', false );
oscarssanchez marked this conversation as resolved.
Show resolved Hide resolved
} else {
$dismiss = get_option( 'ep_hide_maybe_wrong_mapping_notice', false );
}

// we need a host
$host = Utils\get_host();
if ( empty( $host ) ) {
return false;
}

// we also need a version
$es_version = Elasticsearch::factory()->get_elasticsearch_version( false );

if ( false == $es_version ) {
return false;
}

// we also likely need a sync to have a mapping
if ( defined( 'EP_IS_NETWORK' ) && EP_IS_NETWORK ) {
$dismiss = get_site_option( 'ep_hide_maybe_wrong_mapping_notice', false );
$last_sync = get_site_option( 'ep_last_sync', false );
} else {
$dismiss = get_option( 'ep_hide_maybe_wrong_mapping_notice', false );
$last_sync = get_option( 'ep_last_sync', false );
}

if ( $dismiss == $es_version ) {
if ( empty( $last_sync ) ) {
return false;
}

Expand Down