So, I'm trying to import content from a table called "nodes_to_import". I created and populated the table in my Drupal db. Here's what I'd expect to see when I go to /admin/content/tw:

[attachment 1]

...and here's what I see:

[attachment 2]

In other words, TW doesn't seem to be able to see the tables of my current database. This prevents me from adding my content table. I've gotten around this by exporting the table as a csv, and then importing it via TW's "Import Delimited Files" sub-module -- having done that, I can see and analyze the table in TW. But then the main point of all this, which is to get TW to create a view of my table, still isn't accomplished. In other words, when I go to admin/content/migrate and look under "Source view from which to import content:", I ought to see a row like "tw: nodes_to_import (nodes_to_import)" -- which TW should provide -- but it's not there.

Does anybody have any ideas as to why this might happen? I should note that running code like this:

global $db_url;
if (is_array($db_url)) {
  $string = print_r($db_url, TRUE);
}
else {
  $string = $db_url;
}

drupal_set_message($string ? $string : 'zilch');

$sql = 'SHOW TABLES';
$result = db_query($sql);
while ($row = db_fetch_array($result)) {
  foreach ($row as $tablename) {
    drupal_set_message($tablename);
  }
}

successfully shows my db connection and tables, so the problem would appear to be downstream from there...

CommentFileSizeAuthor
PastedGraphic-5.png21.22 KBbdimaggio
PastedGraphic-4.png48.81 KBbdimaggio
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeryan’s picture

Status: Active » Postponed (maintainer needs more info)

Anything unusual about the how you have $db_url set? Do you have multiple connections in $db_url? Are you using database prefixes?

You might want to look at tw_tw_form() in tw_pages.inc and throw in drupal_set_message() in a few places...

Thanks.

mikeryan’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

No further info provided.

ericaordinary’s picture

Hi, I'm having a similar issue. I want to use TW to bring my custom civicrm tables into views, as the civicrm views integration doesn't seem to be working very well. Currently TW doesn't see any of my existing tables (either drupal or civicrm).

My civi is in a separate database to my drupal, and I've put the following into my settings.php file and flushed all caches with no result:

$db_url['default'] = 'mysqli://root:pass1@localhost/anhlc_local';
$db_url['civicrm'] = 'mysqli://root:pass1@localhost/civicrm';

Any help will be much appreciated!

Cheers,
Erica.

ericaordinary’s picture

Status: Closed (fixed) » Active
mikeryan’s picture

Status: Active » Postponed (maintainer needs more info)

See comment 1 - can you add some drupal_set_message() calls to tw_tw_form() and verify that you're getting results (a list of tables) for the SHOW TABLES query? Also, you might verify that your MySQL username does have permission to do SHOW TABLES.

alphageekboy’s picture

I'm having the exact same issue. Except that TW sees my Civi tables, but not my Drupal tables. Did you ever get this resolved?

dparizek’s picture

This is a conflict with CiviCRM. Specifically with database table prefixing. If you look in your drupal settings file, you likely have a whole bunch of db prefixes for civicrm. If you remove those, then Table Wizard works and shows the tables.

So to use with civicrm, it must mean having to deal with the database prefixes somehow.