-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Fix undismissable store alert when using language localization #38967
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
Conversation
Test Results SummaryCommit SHA: e3b15b8
To view the full API test report, click here. To view the full E2E test report, click here. To view all test reports, visit the WooCommerce Test Reports Dashboard. |
143fcdc to
a92da63
Compare
|
Hi @octaedro, Apart from reviewing the code changes, please make sure to review the testing instructions as well. You can follow this guide to find out what good testing instructions should look like: |
louwie17
left a comment
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.
Tested well, I did leave a suggestion around your solution approach. I think it may leave a bit to much room for error.
Also might be worth creating a couple tests for this.
| $actions_length = count( $localized_actions ); | ||
| // Manually copy the action id from the db to the localized action, since they were not being provided. | ||
| for ( $i = 0; $i < $actions_length; $i++ ) { | ||
| $localized_actions[ $i ]->id = $actions_from_db[ $i ]->id; |
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.
I suppose this will do for now, it is a bit of a dirty hack, and there is no way to know if the order of the actions are the same.
I would instead create a get_action_by_name function and add the id based on that.
Something like this: $localized_actions[ $i ]->id = Notes::get_action_by_name( $note_from_db, $localized_actions[ $i ]->name )->id ( if the action exists of-course )
louwie17
left a comment
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.
LGTM 🚀 This is still testing great, and thanks for updating the implementation, it looks great now!
Also thanks for updating the test 👍
Submission Review Guidelines:
Changes proposed in this Pull Request:
Closes #36913 .
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
Changelog entry
Significance
Type
Message
Fix undismissable store alert when using language localization
Comment