-
Notifications
You must be signed in to change notification settings - Fork 313
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
Conversation
currently on the index. It compares it against the expected mapping version and displays a dismissable notice. The notice dismissal is dependent on the es_version This changeset also introduces the _meta mapping to store the mapping version for a more predicatble detection
This fixes #1471 |
includes/classes/AdminNotices.php
Outdated
return false; | ||
} | ||
|
||
$mapping_file_wanted = '5-2.php'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self - Refactor in next version to abstract this out to dedicated function
Tests are currently failing due to the way other tests are structured. Will need to change admin notices test cases to properly reflect the expected mapping version and create new test cases for the version notice |
…rs for manipulation
Should we add the same for other mappings we have? (terms, user, etc) and, if we do it, we should probably rename the new introduced filters. Also needed to update the since tags. |
includes/classes/AdminNotices.php
Outdated
} | ||
|
||
if ( ! $mapping_file_current || $mapping_file_wanted !== $mapping_file_current ) { | ||
$html = sprintf( '%1$s <em>--setup</em> %2$s', esc_html__( 'It seems the mapping data in your index does not match the Elasticsearch version used. We recommend to reindex your content using the sync button on the top of the screen or through wp-cli by adding the', 'elasticpress' ), esc_html__( 'flag.', 'elasticpress' ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In terms of i18n, this string isn't great. It would be much better for translators if this were:
$html = sprintf(
/* translators: 1. <em>; 2. </em> */
esc_html__( 'It seems the mapping data in your index does not match the Elasticsearch version used. We recommend to reindex your content using the sync button on the top of the screen or through wp-cli by adding the %1$s--setup%2$s flag', 'elasticpress' ),
'<em>',
'</em>'
);
@oscarssanchez, I've fixed WP Acceptance tests in #2281 and pushed a commit addressing a few things here. Do you mind checking everything again? |
Looks good @felipeelia |
This changeset implements a way to determine the mapping version currently on the index.
It compares it against the expected mapping version and displays a
dismissable notice.
The notice dismissal is dependent on the es_version
This changeset also introduces the _meta mapping to store the mapping
version for a more predicatble detection