Simple Machines Community Forum

Customizing SMF => Bridges and Integrations => Topic started by: JerzyLS on November 07, 2016, 09:46:42 AM

Title: BlogBridger - wrong database
Post by: JerzyLS on November 07, 2016, 09:46:42 AM
Hey,

I just downloaded the SMF WP-Bridge from here:
https://github.com/SimpleMachines/bridges

Earlier it was working from me.

But now when I'm going to users role setup I see the error:

QuoteTable 'dbex_forum.wp_options' doesn't exist
File: pathtomyforum/Sources/WordpressBridge.php
Line: 619

I see that the database name is wrong, it should be dbex_wordpress, not dbex_forum...
The username is the same.

Content of the file on line 619:

        // Get the WP roles
        $request = $smcFunc['db_query']('', '
SELECT option_value
FROM {raw:wp_prefix}options
WHERE option_name LIKE {string:wp_roles}',
                array(
                    'wp_prefix' => $this->db_prefix,
                    'wp_roles' => 'wp_user_roles',
                ),
                $this->db_connection);
        list($wp_roles) = $smcFunc['db_fetch_row']($request);
        $smcFunc['db_free_result']($request);
        $context['wpRoles'] = unserialize($wp_roles);

In packages this modifications is called as "BlogBridger" and working with emulation of SMF 2.0 RC5.

Title: Re: BlogBridger - wrong database
Post by: JerzyLS on November 09, 2016, 05:32:03 PM
bump
Title: Re: BlogBridger - wrong database
Post by: vbgamer45 on November 09, 2016, 06:09:36 PM
I would check the word press settings inside SMF
It runs this code.
  if (empty($modSettings['wordpress_path']) || !is_readable($modSettings['wordpress_path'] . '/wp-config.php'))


This wordpress_path in SMF must be set to path of wordpress.