Upgrade to Anspress 4
Upgraded one live site and got:
[11-Feb-2017 16:41:59 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘post_type IN (‘question’, ‘answer’) LIMIT 0,50′ at line 1 for query SELECT SQL_CALC_FOUND_ROWS ID, post_type, post_parent, post_status FROM wp_posts LEFT JOIN wp_ap_qameta ON post_id = ID WHERE ptype IS NULL post_type IN (‘question’, ‘answer’) LIMIT 0,50 made by do_action(‘wp_ajax_ap_migrator_4x’), WP_Hook->do_action, WP_Hook->apply_filters, AnsPress_Admin_Ajax::ap_migrator_4x, AP_Update_Helper->__construct, AP_Update_Helper->migrate_post_data
Here is a new one, after todays updates:
[13-Feb-2017 09:00:21 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘)’ at line 1 for query SELECT * FROM wp_posts WHERE ID in () made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/themes/justwrite/page.php’), get_template_part, locate_template, load_template, require(‘/themes/justwrite/page-templates/template-page.php’), the_content, apply_filters(‘the_content’), WP_Hook->apply_filters, do_shortcode, preg_replace_callback, do_shortcode_tag, AnsPress_BasePage_Shortcode->anspress_sc, ap_page, AnsPress_Profile_Hooks::user_page, include(‘/plugins/anspress-question-answer/templates/addons/user/index.php’), AnsPress_Profile_Hooks::sub_page_template, AnsPress_Reputation_Hooks::reputation_page, AnsPress_Reputation_Query->__construct, AnsPress_Reputation_Query->query, AnsPress_Reputation_Query->prefetch, AnsPress_Reputation_Query->prefetch_posts
Fixed
Also the reputation seems off (but fixed after i posted a new Question) :
Have you turned on reputation add-on
Yes of cource, Still maybe that user had no reputation because after he added some question, the reputation increased.
Ok I will fix it. Thanks
Thinking about my previous comment: can’t be that the user had no reputation, since he had posted 4-5 questions and answers.
Maybe the reputation has not been updated/ugraded since now i see him with a reputation of 2 (he posted one new question=2).
Reputation migration issue got fixed. Please check and lemme know if there are any further issues.
Rahul how can i fix this to an already upgraded Anspress 4 ?
go to PhpMyAdmin -> wp_options and find anspress_updates and delete it. And now go to this link https://yourdomain.com/wp-admin/admin.php?page=anspress_upgrade and start upgrade.
Did that, and it doesn’t work for some reason. Nothing happens. i mean upgrade page shows and nothing.
Oh its because your old rows are already deleted in first migration. Please restore DB and and then try.
Fixed
partially fixed. Questions and Answers listing is fixed but tReputaion is empty and probably giving some fatal SQL syntax error.
Please show me error.
Here is a new one, after todays updates:
[13-Feb-2017 09:00:21 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘)’ at line 1 for query SELECT * FROM wp_posts WHERE ID in () made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/themes/justwrite/page.php’), get_template_part, locate_template, load_template, require(‘/themes/justwrite/page-templates/template-page.php’), the_content, apply_filters(‘the_content’), WP_Hook->apply_filters, do_shortcode, preg_replace_callback, do_shortcode_tag, AnsPress_BasePage_Shortcode->anspress_sc, ap_page, AnsPress_Profile_Hooks::user_page, include(‘/plugins/anspress-question-answer/templates/addons/user/index.php’), AnsPress_Profile_Hooks::sub_page_template, AnsPress_Reputation_Hooks::reputation_page, AnsPress_Reputation_Query->__construct, AnsPress_Reputation_Query->query, AnsPress_Reputation_Query->prefetch, AnsPress_Reputation_Query->prefetch_posts
Trying to fix the menu structure.
[12-Feb-2017 10:17:34 UTC] PHP Fatal error: Uncaught Error: Call to a member function get_queried_object() on null in /home/wp-includes/query.php:45
Stack trace:
#0 /home/wp-content/plugins/anspress-question-answer/includes/functions.php(137): get_queried_object()
#1 /home/wp-content/plugins/anspress-question-answer/includes/functions.php(160): is_anspress()
#2 /home/wp-content/plugins/anspress-question-answer/includes/views.php(40): is_question()
#3 /home/wp-includes/class-wp-hook.php(298): AnsPress_Views::insert_views(”)
#4 /home/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(NULL, Array)
#5 /home/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
#6 /home/wp-includes/load.php(677): do_action(‘shutdown’)
#7 [internal function]: shutdown_action_hook()
#8 {main}
thrown in /home/wp-includes/query.php on line 45
Fixed.
Also it seems that my menus with Anspress must be rebuild. Is that correct ? Or a problem i shouldn’t have ?
Yes, Menu structure is update in latest version.
Just fixed it. Its look like this type is created in recent bug finding