Mar 31, 2019 9:50 pm
I'm seeing this bug only on Q/A forums. The topic icons don't change when solved. It's fine after I clear the topic cache. But I need to do it everytime. Now I'm using v1.6.1 and it's still the same.Â
5 Replies
Feb 08, 2020 10:11 am
Hi @spider,
We just fixed this issue, it'll be available with next update. If you need it fix urgently you can edit this file:
/wp-content/plugins/wpforo/wpf-includes/wpf-hooks.php file.
Find this part of code:
if( FALSE !== WPF()->db->query( "UPDATE ".WPF()->tables->posts." SET is_answer = ".intval($_POST['answerstatus'])." WHERE postid = " . intval($postid) ) ){
wpforo_clean_cache('post', $postid, $post);
do_action('wpforo_answer', intval($_POST['answerstatus']), $post);
WPF()->notice->add('done', 'success');
$response['stat'] = 1;
$response['notice'] = WPF()->notice->get_notices();
}
Change it to this:
if( FALSE !== WPF()->db->query( "UPDATE ".WPF()->tables->posts." SET is_answer = ".intval($_POST['answerstatus'])." WHERE postid = " . intval($postid) ) ){
wpforo_clean_cache('post', $postid, $post);
do_action('wpforo_answer', intval($_POST['answerstatus']), $post);
WPF()->db->query( "UPDATE ".WPF()->tables->topics." SET `solved` = " . intval($_POST['answerstatus']) . " WHERE `topicid` = " . intval($post['topicid']) );
WPF()->notice->add('done', 'success');
$response['stat'] = 1;
$response['notice'] = WPF()->notice->get_notices();
}
Â