0

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..

  • after creating A, it should redirect to A. I think you need to find out why it is not doing the default behavior – 2pha Sep 28 '14 at 4:19
0

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->uid; $result = db_query ( "SELECT * FROM {og_membership} WHERE etid = :uid and entity_type = 'user' order by gid DESC", array (':uid' => $uid ) );

Then i used this for my page redirect:

<?php print "node/".$_SESSION['ses_user_group_gid']; ?>

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.