-
Notifications
You must be signed in to change notification settings - Fork 800
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
Sync: listen for status changes on Woo product reviews #13079
Conversation
Caution: This PR has changes that must be merged to WordPress.com |
Thank you for the great PR description! When this PR is ready for review, please apply the Scheduled Jetpack release: August 6, 2019. |
I'd love to add a unit test or two here, but i cannot figure out how to run Woo tests on my docker setup. |
@roccotripaldi I'll give this a test tomorrow, sorry I didn't get to it today. |
I've added a simple test that makes sure that registering a custom comment type works from the point of view of the Comments sync module. We could add another one for WooCommerce, but it doesn't seem that the current tests are working. I'll work on a fix for them, and add another test case afterwards. |
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.
This appears to be working great! I only have a suggestion regarding naming, which I'm just going to address directly, as I'm already touching the branch.
* return array The list of comment types with 'review' added. | ||
*/ | ||
public function add_review_comment_types( $comment_types ) { | ||
if ( is_array( $comment_types ) ) { |
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.
Is this check necessary? I've noticed we don't do these on other filters that work in a similar way.
Also, @roccotripaldi in case you were wondering how to run the Woo tests, considering they're fixed (in this branch or in #13080):
Also documented in the testing instructions of #13080. |
@roccotripaldi @timmyc in 46ca0c6 I've just added a couple of test cases that verify that approving and unapproving a review is being synced as expected. |
This is looking good from my perspective 👍 But since I touched the branch quite a bit, let's get someone else from Crew/Poseidon to review it. |
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 like it. This will actually fix #12830 as well, since the Action Scheduler comments use a custom comment type, action_log
. Here is an example:
+----------------------+---------------------+
| Field | Value |
+----------------------+---------------------+
| comment_ID | 139 |
| comment_post_ID | 702 |
| comment_author | ActionScheduler |
| comment_author_email | |
| comment_author_url | |
| comment_author_IP | |
| comment_date | 2019-07-17 22:53:21 |
| comment_date_gmt | 2019-07-17 20:53:21 |
| comment_content | action created |
| comment_karma | 0 |
| comment_approved | 1 |
| comment_agent | ActionScheduler |
| comment_type | action_log |
| comment_parent | 0 |
| user_id | 0 |
+----------------------+---------------------+
I'll update that other PR to only include the CPT blacklist.
46ca0c6
to
be275db
Compare
Rebasing after merging #13080, i am able to run the new unit tests, and they pass! I think it's ready! |
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.
Looks good!
* Sync: sort blacklisted post types alphabetically * Sync: add Action Scheduler to the list of blacklisted post types Fixes #12714 Those events do not need to be synced with WordPress.com. * [not verified] Sync: do not sync comments made via Action Scheduler * Revert "[not verified] Sync: do not sync comments made via Action Scheduler" This reverts commit f481a2b. No need for this exception once #13079 will be merged.
* Add initial changelog / testing list changes for 7.6 * Update stable tag to 7.5.3 * changelog: add #12957 * Changelog: add #12932 * Changelog: add #12867 * Changelog: add #12823 * changelog: add #12969 * changelog: add #13012 * changelog: add #12974 * Changelog: add #13059 * Changelog: add #13079 * Changelog: add #12924 * changelog: add #12954 * Changelog: add #12959 * Changelog: add #12977 * Changelog: add #12830 * Changelog: add #12926 * Changelog: add #12958 * Changelog: add #12999 * Changelog: add #13077 * Changelog: add #13083 * Changelog: add #13087 * Changelog: add #13110 * Changelog: add #13116 * Changelog: add #13117 * Changelog: add #12821 * Changelog: add #13120 * changelog: add #13139 * Changelog: add #13143 * Changelog: add #13147 * Testing list: add section about sync
* Add initial changelog / testing list changes for 7.6 * Update stable tag to 7.5.3 * changelog: add #12957 * Changelog: add #12932 * Changelog: add #12867 * Changelog: add #12823 * changelog: add #12969 * changelog: add #13012 * changelog: add #12974 * Changelog: add #13059 * Changelog: add #13079 * Changelog: add #12924 * changelog: add #12954 * Changelog: add #12959 * Changelog: add #12977 * Changelog: add #12830 * Changelog: add #12926 * Changelog: add #12958 * Changelog: add #12999 * Changelog: add #13077 * Changelog: add #13083 * Changelog: add #13087 * Changelog: add #13110 * Changelog: add #13116 * Changelog: add #13117 * Changelog: add #12821 * Changelog: add #13120 * changelog: add #13139 * Changelog: add #13143 * Changelog: add #13147 * Testing list: add section about sync
Fixes an issue where a product review status ( approved / unapproved ) appear incorrectly on Wordpress.com
Changes proposed in this Pull Request:
Is this a new feature or does it add/remove features to an existing part of Jetpack?
Testing instructions:
Proposed changelog entry for your changes: