Stephen Welgemoed
asked 9 years ago

Hi guys
 
I found the DW Question Answer plugin yesterday and it works well. After installing it, there was an update available, so I installed the updates.
 
I now have the issue that when a user comments on a question or answer, it shows logged as Anonymous and then the comment doesn’t get saved at all.
 
I can’t seem to find out how to fix this. Do you perhaps have any tips for me on where I can check to see why the comments are not working?
 
Regards
Stephen

5 Answers
DominicStaff
answered 9 years ago

Hi Stephen !
I have checked the DW Q&A plugin on our demo and nothing happens. Please redownload and reinstall the plugin: http://designwall.com/wordpress/plugins/dw-question-answer/
If you still face the same issue, you can can send me username & password of your site for further checking (via  private answer).

Stephen Welgemoed
replied 9 years ago

Thanks for all your help Dominic 🙂 Much appreciated

DominicStaff
answered 9 years ago

Hello Stephen !
Please send me your site for further checking about comment issue. And  right now we already have the option for anonymous answer and comment. It is in the admin > Q&A > Settings > Permission of the plugin.
If you mean anonymous question, then unfortunately we do not support it yet. Will soon discuss and have it in later versions of the plugin :)
Cheers

Stephen Welgemoed
replied 9 years ago

Hi Dominic

Unfortunately my site is not an external facing site.

We are using this plugin for an internal question and answer setup.

I have checked in the Permissions settings and Anonymous can only read answers etc.

To give you a little more detail :

I am logged into the site and navigate to an open question. I then click on the “Write a reply…” comment box under the question (or answer). I type out the entire comment and everything looks correct. As soon as I click Post Comment, the dwqa-comment-content div is empty, the dwqa-comment-author span has Anonymous in it and the dwqa-comment-author div is empty.

When I refresh the page, that block of HTML is gone completely and the comment isn’t anywhere to be found in the system.

Regards
Stephen

Anik
answered 9 years ago

Reinstall the plugin.

Rian Botha
answered 9 years ago

I experienced the same problem, even after reinstalling the plugin.
I found that if I modify dwqa_comment_action_add in actions.php with the following it works (I’ve made the line I added bold):

function dwqa_comment_action_add(){
global $current_user;

if( ! dwqa_current_user_can(‘post_comment’) ) {
wp_send_json_error( array(
‘message’ => __( ‘You can\’t post comment’,’dwqa’ )
) );
}
$args = array(
‘comment_post_ID’ => $_POST[‘comment_post_ID’],
‘comment_content’ => $_POST[‘content’],
‘comment_parent’ => $_POST[‘comment_parent’]
);
if( is_user_logged_in() ) {
$args[‘user_id’] = $current_user->ID;
$args[‘comment_author’] = $current_user->display_name;
} else {
if( !isset($_POST[’email’]) || !$_POST[’email’] ) {
wp_send_json_error( array(
‘message’ => __(‘Missing email infomation’,’dwqa’)
) );
}
if( !isset($_POST[‘name’]) || !$_POST[‘name’] ) {
wp_send_json_error( array(
‘message’ => __(‘Missing name infomation’,’dwqa’)
) );
}
$args[‘comment_author’] = isset($_POST[‘name’]) ? $_POST[‘name’] : ‘anonymous’;
$args[‘comment_author_email’] = $_POST[’email’];
$args[‘comment_author_url’] = isset($_POST[‘url’]) ? $_POST[‘url’] : ”;
$args[‘user_id’] = -1;
}

$comment_id = wp_insert_comment( $args );
do_action( ‘dwqa_add_comment’, $comment_id );
global $comment;
$comment = get_comment( $comment_id );
ob_start();
$args = array(‘walker’ => null, ‘max_depth’ => ”, ‘style’ => ‘ol’, ‘callback’ => null, ‘end-callback’ => null, ‘type’ => ‘all’,
‘page’ => ”, ‘per_page’ => ”, ‘avatar_size’ => 32, ‘reverse_top_level’ => null, ‘reverse_children’ => ”);
dwqa_question_comment_callback( $comment, $args, 0 );
echo ‘</li>’;
$comment_html = ob_get_contents();
ob_end_clean();
wp_send_json_success( array(
‘html’ => $comment_html
) );
}

harsh deshmukh
replied 9 years ago

Great work..Really helpful..:)

DominicStaff
answered 9 years ago

@Rian !
Thank for your solutions in our DW Q&A plugin.

jamespratt
replied 5 years ago

Hi, comment not working on my site too. It shows “Please enter your comment content”. I already sent you my user details at [email protected]

Dominic Staff
replied 5 years ago

Yes, we will check your email now.

jamespratt
replied 5 years ago

Hey, again i am facing same problem “Please enter your comment content”

jamespratt
replied 5 years ago

Please help @Dominic; Urgent it’s a live site, hope you can understand

Dominic Staff
replied 5 years ago

Please accept my apology for the delay in getting back to you. I have checked our email but I can not access your site, I have created an account and can not get the email confirm and password.

Dominic Staff
replied 5 years ago

I have checked your site and see that you should check the plugins in your site, you can disable all the plugin to check this issue. I think it’s conflict between the plugins.

jamespratt
replied 5 years ago

Hey, sorry I was offline. How can I pass you the info? Also, I faced this problem many times.

jamespratt
replied 5 years ago

Are you here now?

Dominic Staff
replied 5 years ago

You can send your info via email: [email protected]

Powered by DW Question & Answer Pro