Title: A bug when exec comments sync
Last modified: July 8, 2020

---

# A bug when exec comments sync

 *  [quasarzero](https://wordpress.org/support/users/quasarzero/)
 * (@quasarzero)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/a-bug-when-exec-comments-sync/)
 * disqus-comment-system/rest-api/class-disqus-rest-api.php
    > comment_data_from_post
 * In this method(comment_data_from_post), there are some code lines.
 *     ```
       $identifiers = $thread['identifiers'];
       $first_identifier = count( $identifiers ) > 0 ? $identifiers[0] : null;
   
       if ( null !== $first_identifier ) {
           $ident_parts = explode( ' ', $first_identifier, 2 );
           $wp_post_id = reset( $ident_parts );
       }
       // Keep the post's thread ID meta up to date.
       update_post_meta( $wp_post_id, 'dsq_thread_id', $thread['id'] );
       ```
   
 * This line `$first_identifier = count( $identifiers ) > 0 ? $identifiers[0] : 
   null;`,
    it will cause the $first_identifier gets the wrong data. Because $identifiers
   may is
 *     ```
       Array
       (
           [0] => https://xxxx.com/knowledge/solved-discord-screen-share-audio-not-working/
           [1] => 87956 https://xxxx.com/?post_type=knowledgebase&p=87956
       )
       ```
   
 * .
 * `$identifiers[0]` cannot get any valid post_id!
    Finally, $wp_post_id is a url
   string, not integer id, the comment will lose the relation with its post.
 * Please optimize it. Thank you!
    -  This topic was modified 5 years, 10 months ago by [quasarzero](https://wordpress.org/support/users/quasarzero/).

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [shawn2bro](https://wordpress.org/support/users/shawn2bro/)
 * (@shawn2bro)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/a-bug-when-exec-comments-sync/#post-13114484)
 * I also Encountered this problem ， I hope there will be a solution as soon as
   possible.
 *  [shawn2bro](https://wordpress.org/support/users/shawn2bro/)
 * (@shawn2bro)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/a-bug-when-exec-comments-sync/#post-13119545)
 * This is the first day AFTER we proposed this issue. Is there anyone could help
   me?
 *  [shawn2bro](https://wordpress.org/support/users/shawn2bro/)
 * (@shawn2bro)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/a-bug-when-exec-comments-sync/#post-13124917)
 * This is the second day AFTER we proposed this issue. I will wait your response.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘A bug when exec comments sync’ is closed to new replies.

 * ![](https://ps.w.org/disqus-comment-system/assets/icon.svg?rev=1636350)
 * [Disqus Comment System](https://wordpress.org/plugins/disqus-comment-system/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/disqus-comment-system/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/disqus-comment-system/)
 * [Active Topics](https://wordpress.org/support/plugin/disqus-comment-system/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/disqus-comment-system/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/disqus-comment-system/reviews/)

## Tags

 * [problem](https://wordpress.org/support/topic-tag/problem/)

 * 3 replies
 * 2 participants
 * Last reply from: [shawn2bro](https://wordpress.org/support/users/shawn2bro/)
 * Last activity: [5 years, 10 months ago](https://wordpress.org/support/topic/a-bug-when-exec-comments-sync/#post-13124917)
 * Status: not resolved