• Hi, I have encountered an issue where by all the names of each of my blocks are emptied, individually saving them also doesnt update them, tried using method and pasting the code in my function.php, loaded the yith dashboard and nothing happened on my database end, the block_assoc database wasnt created. Tried to also creating it manually via sql in my phpadmin, reloaded the yith product add on dashboard to no avail. I have just gave up and reverted to my older 4.3 version. Please let me know what other steps I should try, thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Giuseppe Madaudo

    (@askmagic)

    Hi there,

    you used the last code present in the topic?

    if ( ! function_exists( 'yith_wapo_check_db_400' ) ) { function yith_wapo_check_db_400() { // Add ?yith_addons=1 to the URL inside the admin panel will execute all the code. if ( isset( $_GET['yith_addons'] ) ) { global $wpdb; require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); $blocks_table = $wpdb->prefix . 'yith_wapo_blocks'; $assoc_table = $wpdb->prefix . 'yith_wapo_blocks_assoc'; $charset_collate = $wpdb->get_charset_collate(); // 1. BLOCKS TABLE - START $sql_blocks = "CREATE TABLE {$wpdb->prefix}yith_wapo_blocks ( id INT(3) NOT NULL AUTO_INCREMENT, user_id BIGINT(20), vendor_id BIGINT(20), settings LONGTEXT, priority DECIMAL(9,5), visibility INT(1), creation_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, last_update TIMESTAMP, name varchar(255) NOT NULL, product_association varchar(255), exclude_products tinyint(1) NOT NULL, user_association varchar(255), exclude_users tinyint(1) NOT NULL, PRIMARY KEY (id) ) $charset_collate;"; if ( function_exists( 'maybe_create_table' ) ) { maybe_create_table( $blocks_table, $sql_blocks ); } // CREATE COLUMNS FOR BLOCKS TABLE. $blocks_columns = array( 'name' => 'ALTER TABLE ' . $blocks_table . ' ADD name varchar(255) NOT NULL;', 'product_association' => 'ALTER TABLE ' . $blocks_table . ' ADD product_association varchar(255);', 'exclude_products' => 'ALTER TABLE ' . $blocks_table . ' ADD exclude_products tinyint(1) NOT NULL;', 'user_association' => 'ALTER TABLE ' . $blocks_table . ' ADD user_association varchar(255);', 'exclude_users' => 'ALTER TABLE ' . $blocks_table . ' ADD exclude_users tinyint(1) NOT NULL;', ); foreach ( $blocks_columns as $block_column => $block_statement ){ if ( function_exists( 'maybe_add_column' ) ) { maybe_add_column($blocks_table, $block_column, $block_statement); } } // BLOCKS TABLE - END // 2. BLOCKS ASSOC TABLE - START $sql_associations = "CREATE TABLE {$wpdb->prefix}yith_wapo_blocks_assoc ( rule_id bigint(20) NOT NULL, object varchar(255) NOT NULL, type varchar(50) NOT NULL, KEY type (type), KEY object (object) ) $charset_collate;"; if ( function_exists( 'maybe_create_table' ) ) { maybe_create_table($assoc_table, $sql_associations); } // CREATE COLUMNS FOR ASSOCIATION TABLE. $assoc_columns = array( 'rule_id' => 'ALTER TABLE ' . $assoc_table . ' ADD rule_id varchar(255) NOT NULL;', 'object' => 'ALTER TABLE ' . $assoc_table . ' ADD object varchar(255) NOT NULL;', 'type' => 'ALTER TABLE ' . $assoc_table . ' ADD type varchar(50) NOT NULL;', ); foreach ( $assoc_columns as $assoc_column => $assoc_statement ){ if ( function_exists( 'maybe_add_column' ) ) { maybe_add_column($assoc_table, $assoc_column, $assoc_statement); } } // BLOCKS ASSOC TABLE - END // 3. UPDATE OPTION - START update_option( 'yith_wapo_db_update_scheduled_for', '2.0.0' ); update_option( 'yith_wapo_db_version_option', '2.0.0' ); //UPDATE OPTION - END } } add_action( 'admin_init', 'yith_wapo_check_db_400' ); }

    Then try to visit your site adding the following url

    https://yoursite.com/wp-admin/admin.php?page=yith_wapo_panel&yith_addon=1

    Note: you need to change yoursite.com and add your domain.

    Note2: I suggest you to execute the code on a staging site before to set it on production. In this way you’ll prevent to generate problems on your production site.

    Please, try it and let me know.

    Thread Starter joonzaii96

    (@joonzaii96)

    yes, I stated that I followed that method by pasting the code within my function.php. Loaded the yith dashboard (the link you gave but with my website domain), doesnt work as well.

    Plugin Support Alessio Torrisi

    (@alessio91)

    Hi there,

    please access to your database and let us know if tables “yith_wapo_blocks” and “yith_wapo_blocks_assoc” have been created.

    Thread Starter joonzaii96

    (@joonzaii96)

    Both yith_wapo_blocks and yith_wapo_blocks_assoc is made. After updating the latest plugin still doesnt show the name in each blocks / section, nor saving works.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Version 4.6.1 Name of blocks are emptied and unable to save’ is closed to new replies.