-
Notifications
You must be signed in to change notification settings - Fork 25
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
Automatic Sync not adding comment post ID #41
Comments
It seems that it only affects moderators. When other users comment, the |
It's not affecting moderators only. It seems to be random. |
The |
Sure. Here Comment 3795193591 appears on my WP comments table but with Now it failed to sync a comment and in the plugin admin it says
|
@eperezf this is really late, but are you still having the issue? A similar issue has been reported. The disqus rest api should always call this function, passing along a valid post id:
comment_post_ID within the context of https://developer.wordpress.org/reference/functions/wp_insert_comment/ that would be very helpful. Does that value come in as 0 initially or is it changed sometime after the call, or during the database write?
|
@dmatt I am continuing #105 with more info. But often I get an error: {
"code": 500,
"message": "Exception: No post found associated with the thread. in /wp-content/plugins/disqus-comment-system/rest-api/class-disqus-rest-api.php:760\nStack trace:\n#0 /wp-content/plugins/disqus-comment-system/rest-api/class-disqus-rest-api.php(669): Disqus_Rest_Api->comment_data_from_post(Array)\n#1 /wp-content/plugins/disqus-comment-system/rest-api/class-disqus-rest-api.php(657): Disqus_Rest_Api->create_comment_from_post(Array)\n#2 /wp-content/plugins/disqus-comment-system/rest-api/class-disqus-rest-api.php(234): Disqus_Rest_Api->create_or_update_comment_from_post(Array)\n#3 /wp-includes/rest-api/class-wp-rest-server.php(1139): Disqus_Rest_Api->rest_sync_webhook(Object(WP_REST_Request))\n#4 /wp-includes/rest-api/class-wp-rest-server.php(985): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/disqus/v1/sync...', Array, NULL)\n#5 /wp-includes/rest-api/class-wp-rest-server.php(412): WP_REST_Server->dispatch(Object(WP_REST_Request))\n#6 /wp-includes/rest-api.php(354): WP_REST_Server->serve_request('/disqus/v1/sync...')\n#7 /wp-includes/class-wp-hook.php(292): rest_api_loaded(Object(WP))\n#8 /wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters('', Array)\n#9 /wp-includes/plugin.php(551): WP_Hook->do_action(Array)\n#10 /wp-includes/class-wp.php(388): do_action_ref_array('parse_request', Array)\n#11 /wp-includes/class-wp.php(750): WP->parse_request('')\n#12 /wp-includes/functions.php(1291): WP->main('')\n#13 /wp-blog-header.php(16): wp()\n#14 /index.php(17): require('/home/klient.dh...')\n#15 {main}",
"data": null
} I also checked the database and see that syncing new comments to old posts works. The last post ID where comment sync works is 393850. Comments synced to posts with higher ID than 393850 (eg. 406427) have SELECT * FROM wp_comments WHERE comment_post_ID != 0
ORDER BY wp_comments.comment_post_ID DESC |
@rafaucau Thank you. I'm seeing 3 different issues in the info you provided, the 3rd is relevant to this issue #41. I'll provide some info below for each:
SELECT * FROM `wp_postmeta` WHERE post_id = 0 AND meta_key = 'dsq_thread_id' |
@dmatt The query you provided returns 0 results. SELECT * FROM `wp_postmeta` WHERE post_id = 0 AND meta_key = 'dsq_thread_id' But if i run: SELECT * FROM `wp_postmeta` WHERE meta_key = 'dsq_thread_id' ORDER BY `wp_postmeta`.`post_id` DESC Then I see that the last post ID is |
Thank you @rafaucau, so it appears that maybe post 0 does not exist and dsq_thread_id is not properly set at all. Do you have some way of inspecting/printing the $post object that is passed to this function for a comment that is synced incorrectly?
I haven't been able to reproduce this so I'm hoping that maybe we can take a look at that $post object to understand what might be failing in |
@dmatt I added private function comment_data_from_post($post) {
error_log(print_r($post));
... And here's what was logged:
So |
Hi,
After re-enabling the sync feature, I made 2 comments on disqus that appear on the Wordpress database but the
comment_post_ID
column appears as 0 so the comments on the sidebar have the wrong post URL and they don't count in the post comment counter.The comment agent used to be
Disqus/1.1(2.87):XXXXXXXX
but now it'sDisqus Sync Host
.The text was updated successfully, but these errors were encountered: