WordPress.org

Ready to get started?Download WordPress

Forums

WP2Cloud
Error on switch_blog (3 posts)

  1. i.pace
    Member
    Posted 7 months ago #

    Hi,
    I noticed what may be a bug in the plugin, since the internal ClouSE_table_name is initialized only on plugin startup.

    If another plugin runs switch_blog and needs to gather images from this new blog, the ClouSE_table_name isn't reflecting the blog we're actually operating upon after switch.

    That's the case of one custom plugin we're using.

    This can be easily fixed add an hook in addhooks():
    add_action('switch_blog', array(&$this, 'update_current_blog'), 10, 2);

    and adding a function to update the internal ClouSE_table_name:

    function update_current_blog ($new_blog, $prev_blog) {
                global $wpdb;
    // in Multisite, it's main blog
                if ($new_blog!=1) {
                    $this->ClouSE_table_name = $wpdb->base_prefix . $new_blog . "_cloud_media_content";
                } else {
                    $this->ClouSE_table_name = $wpdb->base_prefix . "cloud_media_content";
                    }
            }

    http://wordpress.org/plugins/wp2cloud-wordpress-to-cloud/

  2. Artem Livshits
    Member
    Plugin Author

    Posted 7 months ago #

    Thank you for the detailed report! We'll investigate and fix this issue soon.

  3. Artem Livshits
    Member
    Plugin Author

    Posted 7 months ago #

    The fix is released in WP2Cloud v1.3.13.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.