• XCloner Version 4.6.2 & WP multisite Version 6.1.1

    On a new WP multisite install, when I try to save changes in xcloner i get the following error:

    WordPress database error Table '[dbnamehere].xcloner_scheduler' doesn't exist for query SELECT * FROM xcloner_scheduler made by require_once('wp-admin/admin.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/xcloner-backup-and-restore/xcloner.php'), run_xcloner, Watchfulli\XClonerCore\Xcloner->init, Watchfulli\XClonerCore\Xcloner->define_cron_hooks, Watchfulli\XClonerCore\Xcloner_Scheduler->update_wp_cron_hooks, Watchfulli\XClonerCore\Xcloner_Scheduler->get_scheduler_list

    The dbname is correct but the table prefix isn’t being added to the search. The table tableprefix_xcloner_scheduler exists and is of the correct structure.

    Xcloner_Database.php defines the table prefix as:

    global $wpdb;
    $this->set_prefix($wpdb->prefix);
    
    parent::__construct($wpdb->dbuser, $wpdb->dbpassword, $wpdb->dbname, $wpdb->dbhost);

    dbuser, dbpassword, dbname, dbhost are all set correctly.

    Scheduler defines the table name like this:

        public function __construct(Xcloner $xcloner_container)
        {
            $this->xcloner_container = $xcloner_container;
    
            $this->xcloner_container->get_xcloner_database()->show_errors = false;
    
            $this->scheduler_table = $this->xcloner_container->get_xcloner_database()->prefix . $this->scheduler_table;
        }
    
        public function get_scheduler_list($return_only_enabled = 0)
        {
            $list = $this->xcloner_container->get_xcloner_database()->get_results("SELECT * FROM " . $this->scheduler_table);

    Any ideas why the Scheduler isn’t getting the table prefix from wp-config.php?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter photoburt

    (@photoburt)

    Editing Xcloner_Database.php lines 58-60 as follows fixes the table name issue:

    global $wpdb;
    /* $this->set_prefix($wpdb->prefix); */
    $this->prefix = $wpdb->prefix;

    The set_prefix function is expecting other values to be set in the Xcloner_Database wpdb object so is returning empty for multisite wp.

    That issue was fixed, but now I’m getting use of undefined constant SECURE_AUTH_COOKIE errors from Xcloner.php’s use of wp_verify_nonce before wp-includes/default-constants.php is included.

    This can be fixed by changing Xcloner.php line 141 to 143 with the new lines (hack) in bold:

    require_once( ABSPATH . '/wp-includes/default-constants.php' );
    require_once( ABSPATH . '/wp-includes/pluggable.php' );
    wp_cookie_constants();
    

    This really should be fixed by not including pluggable at all and adding the function to a hook but I’m out of time for this. I was able to generate a manual backup. When I turn on “Generate Backups before Automatic WP Upgrades” on the xcloner_settings_page page I get a 403 error when I hit save.

    Getting the same issue on multisite. The DB table "wp_xcloner_scheduler" is there, however the app seems to expect an unprefixed version.

    "Table 'k158415.xcloner_scheduler' doesn't exist"
    • This reply was modified 1 year, 2 months ago by btxtiger.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘xcloner_scheduler doesn’t exist’ is closed to new replies.