I swear this used to work, but I also might be misremembering. In any case, we should probably document this behaviour a bit better, which I'm willing to do once I figure out what's going on. :)
I have two tables:
groupinfo (analogous to "roles")
group_id (PK)
groupname
user_accounts (analogous to "users")
id (PK)
password
group_id (FK)
... some other stuff
I want to import the users, retaining their role assignments. Migrate module does not expose "Role ID" as a possible mapping destination, so my guess is I need to trigger the import based on human-readable name.
I tried to do this by defining a relationship between the two tables. I checked off user_accounts.group_id as an "available key" then went to admin/content/tw/relationships and set:
* Base table field: user_accounts.group_id
* Related table field: groupinfo.group_id
* Automation: Automatic
(I also tried flipping these in case I got this wrong, and adding relationships for both directions, and changing the automation type from auto to manual. Same behaviour in all cases.)
What I expected to happen as a result is when I go back and view the auto-generated view for the user_accounts table, I would see groupinfo data in it. Instead, I do not see that, and when I try and go in and manually add the relationship myself by editing the View, it tells me "No relationships found."
So. Bug, or did I miss a step? :)
Comments
Comment #1
mikeryanIt seemed to work for me (the desired scenario, Automatic relationship from user_accounts to groupinfo), but I got a notice for an undefined variable $colcolname, line 95 of tw.views_default.inc. It was an obvious bug, so I've committed a fix for that, although since I didn't reproduce what you saw I can't be sure it fixes it for you (I'm guessing the difference could be versions of Views, schema_version 6007 for me, which I'm sure is stale). It certainly shouldn't hurt, though...
Comment #2
mikeryanComment #3
webchickHuh. Well I don't know what my problem is then!
I've tried both with the latest stable version of each module (Schema, Table Wizard, Views) as well as the latest bleeding edge code from CVS. In both cases I'm not seeing any relationships in Views. Even tried a fresh install in case I'd jacked something up.
Time to whip out a debugger, I guess... :P
Comment #4
webchickTurns out yep, I'm stupid. ;) I was thinking "Automatic" was going to change the default view to automatically suck in table columns from the related table. But no. Automatic means something *totally* different. See: #610054: Confusing terminology: Automatic vs. Manual
I'm re-titling to make this issue about the notice. Which, woohoo! Yay for stupidity leading to notice fixes. :D