Getting redirected to the referenced node instead of the created node after node save I have two organic nodetypes.
One of the types has a prepopulated reference field referencing the other nodetype.
This means that when i create a node of OG type A it will automatically reference to OG type B.

My problem however is that when i save nodetype A it i get redirected to nodetype B.

I am looking for a way to (using rules ) redirect to nodetype A (the node just created, which is the normal workflow).

Help appreciated..
As a workaround i created a rule (rules module) where i redirected the user upon saving new content.
In my action i used this piece of code:

global $user;
$uid = $user-&gt;uid;
$result = db_query ( "SELECT * FROM {og_membership}
WHERE etid = :uid
and entity_type = 'user'
order by gid DESC", array (':uid' =&gt; $uid ) );

Then i used this for my page redirect:

&lt;?php print "node/".$_SESSION['ses_user_group_gid'];  ?&gt;