• I have multiple errors in my log

    [26-Feb-2020 21:46:33 UTC] WordPress database error Unknown column 'session_id' in 'where clause' for query SELECT ID FROM wp_yith_wcwl_lists WHERE session_id = '8caaea1dcecf068eda8ffc4d0e6c5956' AND expiration > NOW() AND is_default = 1 made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/flatsome/page.php'), get_header, locate_template, load_template, require_once('/themes/flatsome/header.php'), get_template_part, locate_template, load_template, require('/themes/flatsome/template-parts/header/header-wrapper.php'), get_template_part, locate_template, load_template, require('/themes/flatsome/template-parts/header/header-main.php'), flatsome_header_elements, get_template_part, locate_template, load_template, require('/themes/flatsome/template-parts/header/partials/element-wishlist.php'), YITH_WCWL->count_products, YITH_WCWL_Wishlist_Factory::get_wishlist, YITH_WCWL_Wishlist_Factory::get_default_wishlist, WC_Data_Store->__call, YITH_WCWL_Wishlist_Data_Store->get_default_wishlist

    and

    [26-Feb-2020 21:46:32 UTC] WordPress database error Unknown column 'position' in 'order clause' for query SELECT i.* FROM wp_yith_wcwl as i INNER JOIN wp_posts as p on i.prod_id = p.ID WHERE wishlist_id = 0 AND p.post_type IN ( 'product', 'product_variation' ) AND p.post_status = 'publish' ORDER BY position ASC, ID ASC; made by require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters, YITH_WCWL_Form_Handler::add_to_wishlist, YITH_WCWL->add, YITH_WCWL_Wishlist->has_product, YITH_WCWL_Wishlist->get_items, WC_Data_Store->__call, YITH_WCWL_Wishlist_Data_Store->read_items

    I use
    YITH Essential Kit for WooCommerce #1
    YITH WooCommerce Ajax Search
    YITH WooCommerce Best Sellers
    YITH WooCommerce Wishlist

    Any ideas, I have tried to deactivate Yith Wishlist but still no luck and the wishlist doesn’t save. I also use Flatsome theme, which I believe that your plugin is a requirement.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi there

    it seems that there was a problem during db update process

    My suggetion here is to manually trigger update procedure
    In order to do so, visit /wp-admin/options.php, locate option yith_wcwl_db_version, change value to 2.0.0 and save your options

    This should force plugin to update database again: if everything is fine, option will automatically revert to 3.0.0 value

    Let me know if this solves the issue

    Thread Starter albertramsbottom

    (@albertramsbottom)

    Thanks for that but I have tried that before with no luck

    Ummmm

    Hey πŸ™‚

    It solved a problem for me, but only for one site. I have a multisite installation and over 100 websites. My error log is rising a few KB every minute because of this error with database update.

    Do you see any solution to solve this without revisiting each page?

    With kind regards.
    Air.

    Thread Starter albertramsbottom

    (@albertramsbottom)

    That might be my issue as I also have a multisite with 5 woocommerce sites running

    Cheers

    Plugin Author YITHEMES

    (@yithemes)

    @apollo13themes If you need to do the same on a large number of sites of a network, I suggest you to proceed using a snippet of code

    For example, the following code

    function yith_wcwl_force_db_update_on_all_blogs(){
    	if( ! isset( $_GET['yith_wcwl_force_db_update_on_all_blogs'] ) ){
    		return;
    	}
    
    	$blogs = get_sites();
    
    	if( ! empty( $blogs ) ){
    		foreach( $blogs as $blog ){
    			switch_to_blog( $blog->blog_id );
    			echo 'Updating option on blog ' . $blog->blog_id . "... ";
    			update_option( 'yith_wcwl_db_version', '2.0.0' );
    			echo ' option updated!<br>';
    			restore_current_blog();
    		}
    	}
    
    	die;
    }
    add_action( 'init', 'yith_wcwl_force_db_update_on_all_blogs' );
    

    will cycle through all defined blogs and update option for each one of them.
    Then, on next visit, blog will automatically perform update process

    In order to execute the previous code, place it at the end of functions.php, and visit any page of your network, adding ?yith_wcwl_force_db_update_on_all_blogs to the querystring

    Don’t forget to remove this code immediately after you’re done, and avoid executing it multiple times

    Finally, a note on performance: depending on how many sites your network has, this function could take a lot of time, and even failing due to Max Execution Time reached.
    Be warned of the risk

    @albertramsbottom if the solution that I suggested do not solve the issue, my best guess is that something is preventing automatic update procedeure do update db structure

    Please, check your table structure on db, and dobule check that session_id column was actually created in yith_wcwl_lists table; if it is not, try to manually add it (at least for one blog) defining it as VARCHAR(255) NULL column, and check if this solves the issue (maybe you could ask your hosting provider to help with this task, if you don’t feel confortable checking db structure on your own)

    Hey πŸ™‚

    Thanks for the solution and quick response. I believe it can be useful if such a thing occurs again.

    I decided to revisit each admin panel manually in my multisite. I also did then WooCommerce database update on each site, so not really sure which of those actions solved the issue. However, no more errors.

    I just wanted to say that I like such “one-time run” code solutions. Nice one πŸ™‚

    With kind regards.
    Air.

    Plugin Author YITHEMES

    (@yithemes)

    @apollo13themes Glad to hear that you solved the problem, and that you appreciated my code πŸ™‚
    Let me know if I can be of further assistance

    Thread Starter albertramsbottom

    (@albertramsbottom)

    I havent solved the problem and I am the OP πŸ™‚

    Plugin Author YITHEMES

    (@yithemes)

    @albertramsbottom This is the reason why this topic wasn’t set as solved πŸ™‚
    Had you the chance to perform the tests that I suggested in my previous answer?

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

The topic ‘Errors in WordPress log’ is closed to new replies.