When I try to import Visitor and Private Messages from a vB 4.1.4 installation to Drupal 6.25 using Facebook Style Statuses 3.1 and Privatemsg 6.x-2.x-dev it fails with the following errors:

  • user warning: Unknown column 'uid' in 'field list' query: INSERT INTO facebook_status (sid, uid, pid, status_time, status) SELECT vmid+1000000, userid+1000000, postuserid+1000000, dateline, pagetext FROM `my_database`.visitormessage WHERE state = 'visible' AND vmid > 0 AND vmid <= 100000 in on line .
  • user warning: Unknown column 'uid' in 'field list' query: INSERT INTO facebook_status (sid, uid, pid, status_time, status) SELECT vmid+1000000, userid+1000000, postuserid+1000000, dateline, pagetext FROM `my_database`.visitormessage WHERE state = 'visible' AND vmid > 100000 AND vmid <= 200000 in on line .
  • user warning: Unknown column 'uid' in 'field list' query: INSERT IGNORE INTO `my_database`.pm_index (mid, thread_id, uid, is_new, deleted) SELECT pm.pmid+1000000, pm.pmid+1000000, IF(userid=0,0,userid+1000000), IF(messageread<>0,0,1), IF(folderid=(-1),1,0) FROM pm in /sites/all/modules/vbtodrupal/vbtoprivatemsg.module on line 65.
  • user warning: Unknown column 'uid' in 'field list' query: INSERT IGNORE INTO `my_database`.pm_index (mid, thread_id, uid, is_new, deleted) SELECT pm.pmid+1000000, pm.pmid+1000000, IF(fromuserid=0,0,fromuserid+1000000), 0, IF(folderid=(-1),1,0) FROM pm INNER JOIN pmtext ON pm.pmtextid = pmtext.pmtextid in /sites/all/modules/vbtodrupal/vbtoprivatemsg.module on line 76.
  • user warning: Unknown column 'uid' in 'field list' query: SELECT MAX(uid), MAX(pid) FROM facebook_status in on line .
  • user warning: Unknown column 'uid' in 'field list' query: SELECT MAX(uid) FROM pm_index in on line .


Maybe the module needs an update to work with the latest versions of Facebook-Style Statuses and Privatemsg?

Comments

Würden’s picture

Issue summary: View changes

edit

Würden’s picture

Issue summary: View changes

edit

Würden’s picture

Issue summary: View changes

.

Würden’s picture

Issue summary: View changes

.

liam mcdermott’s picture

Version: 6.x-1.7 » 6.x-1.x-dev

Maybe the module needs an update to work with the latest versions of Facebook-Style Statuses and Privatemsg?

Certainly looks that way! Thanks for the bug report, not sure when I'll get to this as I've got a completely unrelated job that has to take priority.

If anyone else wants to have a go at this, the field names are correct in the Drupal 7 version of vB to Drupal (or at least, I hope they are!) and this shouldn't take long to fix, though it'll need testing.

Würden’s picture

This is a really quick fix, not well tested yet:

vbtofss.module replace line 32 with this:
'facebook_status' => array('recipient', 'sender'),

vbtofss.module replace line 50 with this:
$sql = "INSERT INTO {facebook_status} (sid, recipient, sender, created, message)

vbtoprivatemsg.module replace line 30 with:
'pm_index' => array('recipient'),

vbtoprivatemsg.module replace line 58 with:
$sql = "INSERT IGNORE INTO %s (mid, thread_id, recipient, is_new, deleted)

vbtoprivatemsg.module replace line 69 with:
$sql = "INSERT IGNORE INTO %s (mid, thread_id, recipient, is_new, deleted)

EDIT: PM seems to work ok, I can't get the fb statuses to show although they have been added to the database without any errors.

EDIT 2: An alternative upgrade path to FBSS could be to first install version 6.x-2.4, do the import as you normally would and then upgrade the FBSS module to 3.1 using update.php. I finally managed to solve this issue using this workaround.

liam mcdermott’s picture

Thanks for this CFE, I'll use your code as the basis of a patch.

Würden’s picture

I'm not much of a SQL shark unfortunately, I can see this much though: there are no big differences between the database tables, they just changed the names on some of the columns and added indexes. I probably couldn't get it to work because I haven't worked with indexes before - however you should be able to see the upgrade path in the .install-file of each module. An idea/feature request could be to add support for both FBSS v.2.x and 3.x, since you already have the 2.x support.

Würden’s picture

Issue summary: View changes

.