When I do click on the reference node Tab and
I've finished the creation of the related node I
would like to come back to the node that I was
originaly creating...

Thanks

Comments

fossie’s picture

Hello,

I've added :

'query' => 'destination=node/'.arg(1),

to the menu created in the module.

              if (node_access('create', $reftype)) {
                $items[] = array(
                  'path' => 'node/'.arg(1).'/add/'.substr($name, strlen('field_')),
+                  'query' => 'destination=node/'.arg(1),
                  'title' => $field['widget']['title'],
                  'type' => MENU_LOCAL_TASK,
                  'callback' => 'nodereferrer_create_add',
                  'callback arguments' => array($field, $node),
                  'weight' => 10,
                );

Don't know how to post a correct patch.

HTH,
Fossie

vkareh’s picture

Version: 5.x-1.x-dev » 6.x-1.x-dev
Component: User interface » Code
Status: Active » Needs review
StatusFileSize
new3.98 KB
new753 bytes

I created a patch to do this in 6.x-1.x-dev. It properly adds a destination argument in the URL to bring the user back to the original node. It can be turned on/off in the admin settings screen.

shaneonabike’s picture

+1