I'm writing a module to handle migration of user_realationships from another module (in my case buddylist)

The buddylist table has the all the basic info, but i needed to map both the uid and bid to the user_map table I used when i imported my users. I added the buddylist table and setup the relationships with tw, but when i tried to setup the field in the view, I could only get the first mapping field to show up.

The answer was to add the same field twice, then edit the second field and change the relationship to the one you re looking for manually. The relationships appear as the table name, which is exactly the same so you have to guess, but they are in the same order as the views relationships. I would also set a label here to avoid confusion about what new id is what.

This drove me nuts trying to figure out, so I hope it helps someone else. Putting the map tables to dual use will come up any time you want to add a table that references two different ids of the same mapping type (privatemsg, buddylist, friendlist, nodereference?, user_relationships, etc).

If someone what to flesh this out, we can add it to the documentation

Comments

frankcarey’s picture

Category: support » bug

Looks like there is a bug here too. When you create a content set from a view created like the one above and start to map the fields, there is a select option that is repeated, and one of the labels you used in the view for your map fields is missing. So, one has the correct label, and the other has the exact same label (wrongly). If you inspect the form, you can see each is different, and you can probably set it fine if you figure out which is which since they have different ids (one is format "table_field" and the other is "table_1_field", where table_1 is the alias views created to the table so you can join it twice.

Not sure if this is a views or migrate issue.

mikeryan’s picture

Status: Active » Fixed

The original question was self-answered - the second issue is a dupe of #432528: Incorrect Field Labels on Mapping Page w/ Multiple Nodereferences, which is now fixed.

Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.