I'm using the 7.x-2.x-dev version of phpbb2drupal and am getting the following error:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal.phpbb2drupal_temp_topic' doesn't exist: SELECT nid FROM {phpbb2drupal_temp_topic} WHERE topic_id = :topic_id; Array ( [:topic_id] => 11 ) in phpbb_redirect_viewtopic() (line 55 of /path/sites/all/modules/phpbb2drupal/phpbb_redirect.module).

It seems like a temporary table should be created so I grepped the module for a number of words including temp, temporary, table etc yet nothing came up. Looking at the database, no tables have been created (which is unsurprising as that is what the error tells us.) Is this user or module error?

Comments

JeremyFrench’s picture

Status: Active » Closed (cannot reproduce)

I haven't seen any other occurrences of this error. It could be user error. Did you ever get past this?

rmfleet’s picture

Status: Closed (cannot reproduce) » Active

I am seeing the exact same behaviour. Subscribing.

JeremyFrench’s picture

Thanks for re opening this.

A couple of questions, if that is ok?

Where are your phpBB tables, are they in the same DB as your local Drupal install or are they in a different DB? Do you have 'create table' privileges to this DB?

What DB type is this, I must admit that I have only tried mySQL.

rmfleet’s picture

The tables have been imported locally and I have create table rights to the database. I should not that I am not using the dev version, although I have tried it without any success. This is running on mysql.

JeremyFrench’s picture

Version: 7.x-2.x-dev » 7.x-2.0-beta1

So you are using the 7.x-2.0-beta1 version?

Can you see if there are any watchdog entries?

I have never had this problem so it is difficult to debug. Also a list of the tables in your DB may be illuminating.

Thanks.

rmfleet’s picture

Version: 7.x-2.0-beta1 » 7.x-2.x-dev

by modifying the phpbb_redirect.module, and changing the query strings from

tid = db_query('SELECT tid FROM {phpbb2drupal_temp_forum} WHERE forum_id = :forum_id', array(':forum_id' => $forum_id))->fetchField();

to

$tid = db_query('SELECT destid1 FROM {phpbb_migrate_map_phpbbforums} WHERE sourceid1 = :forum_id', array(':forum_id' => $forum_id))->fetchField();

I am able to get forums working as these tables do exist. I can do this for topics as well but the mapping does not match correctly.

adammalone’s picture

When I was experiencing the issue (I have since disabled the phpbb_redirect module)

I had the same conditions as rmfleet here.
The only watchdog messages I got were the ones detailed in the topic description.

JeremyFrench’s picture

Version: 7.x-2.x-dev » 7.x-2.0-beta1

Ah, phpbb redirect is not working in the 7.x-2 branch. If you want redirects to work you may want to have a look at the 7.x-3 branch.

I'll keep this open as I should either fix the redirects in 7.x-2 or remove the redirect module.

rmfleet’s picture

Version: 7.x-2.0-beta1 » 7.x-3.x-dev

I am receiving the following critical error when navigating to the php migration tab after installing the 7.x.3 branch.

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table '{dbname}.phpbb2drupal_instances' doesn't exist: SELECT COUNT(*) AS expression FROM (SELECT 1 AS expression FROM {phpbb2drupal_instances} i) subquery; Array ( ) in PagerDefault->execute() (line 74 of /home/domains/{domain}/public_html/includes/pager.inc).

When trying to uninstall the module, I then got the following:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table '{dbname}.phpbb2drupal_instances' doesn't exist: SELECT m.machine_name AS machine_name FROM {phpbb2drupal_instances} m; Array ( ) in phpbb2drupal_disable() (line 193 of /home/domains/{domain}/public_html/sites/all/modules/phpbb2drupal/phpbb2drupal.install).

where {dbname} is the database being used and {domain} is the path of my domain.

JeremyFrench’s picture

did you run update.php after installing the 7.3 branch? That should install the phpbb2drupal_instances table.

rmfleet’s picture

yes I did. It told me there was nothing to update.

JeremyFrench’s picture

Did you have any further luck or otherwise with this? I have not been able to reproduce this.

rmfleet’s picture

Yes and no. I ended up using the newer dev version as this provided working redirect code, after clearing out all references to the older version. I then ended up hacking through the code to get it to work for this particular project.

It basically fell apart due to the multiple profile abilities in the newer build. I had to manually go into the source and hardcode the table prefixes, otherwise it would ignore the tables stating they could not be found. This was not an issue in the older versions.

For example:

protected function query() {
   return Database::getConnection('default', $this->migration_settings['machine_name'])
    ->select('{phpbb_forums}', 'f')

vs

protected function query() {
   return Database::getConnection('default', $this->migration_settings['machine_name'])
    ->select('{forums}', 'f')
JeremyFrench’s picture

Ahh, were you using local DB?

I had this error the other day, I was normally using different DB. I think commit http://drupalcode.org/project/phpbb2drupal.git/commitdiff/ef224d93e129ed... fixes it. That should be in a build later today.

JeremyFrench’s picture

Status: Active » Closed (fixed)