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

Display grouped error messages with solutions. #3803

Merged
merged 8 commits into from
Apr 10, 2024
Merged

Conversation

JakePT
Copy link
Contributor

@JakePT JakePT commented Jan 3, 2024

Description of the Change

Updates the Errors tab of the Sync page to display error messages grouped by type, with a description that links to supporting documentation.

elasticpress test_wp-admin_admin php_page=elasticpress-sync

Closes #2847

How to test the Change

Use this filter to cause errors to appear.

add_filter( 'ep_total_field_limit', function() { return 100; } );

add_filter(
	'ep_prepare_meta_data',
	function ( $post_meta, $post ) {
		if ( 0 === $post->ID % 2 ) {
			for ( $i = 0; $i < 100; $i++ ) {
				$post_meta[ "test_meta_{$i}_title_{$post->ID}" ] = 'Lorem';
				$post_meta[ "test_meta_{$i}_body_{$post->ID}" ]  = 'Ipsum';
			}
		}
		return $post_meta;
	},
	10,
	2
);

The exact number may need to be reduce to cause an error, depending on your data.

Run a sync, the errors tab should display a result similar to the screenshot.

Run another sync, the count for any repeated errors should increase.

Clear the log, the errors should be cleared as well.

Changelog Entry

Added - A new Sync errors tab, with errors grouped by type and links to support documentation when available.

Credits

Props @JakePT @apurvrdx1

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@JakePT JakePT added module:sync Issues related to the Sync functionality front end Issues mostly related to the Front End like JavaScript/React and CSS. labels Jan 3, 2024
@JakePT JakePT added this to the 5.1.0 milestone Jan 3, 2024
@JakePT JakePT self-assigned this Jan 3, 2024
@JakePT JakePT marked this pull request as ready for review April 9, 2024 06:05
@JakePT JakePT requested a review from felipeelia April 9, 2024 06:05
@felipeelia felipeelia merged commit 0b3f637 into develop Apr 10, 2024
22 checks passed
@felipeelia felipeelia deleted the feature/2847 branch April 10, 2024 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
front end Issues mostly related to the Front End like JavaScript/React and CSS. module:sync Issues related to the Sync functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sync error messages linking to documentation
2 participants