Hello everyone,
After a new node is inserted or an existing node is updated, node.module calls drupal_goto.
I want my still-to-be-written 'nextstep' module to be able to manipulate the destination that Drupal redirects to.
Although I only quickly looked through the attachment.module ( as an example ) and node.module,
I think there's currently no clean way to do this. Am I correct ?
If so, what do you think about adding a 'pre redirect' subhook in hook_nodeapi,
where I can return a string containing the drupal path that the module wants to redirect to ?
If the string is empty, node.module can follow the logic it now does to decide where to redirect.
For an explanation why I want to do this, take a look at http://drupal.org/node/13824
Best regards,
Eric
Comments
My suggestion given as
My suggestion given as acomment to http://drupal.org/node/13824 is still valid. You can add all kind of info through drupal_set_message(). This includes forms, links, and what not. I think the current redirection to the newly created node is the Right Thing(tm) as it lets you check your work. any other offers can be made through drupal_set_message().
I was bored on the train once and created im.module which also (ab)uses drupal_set_message():
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/im/
There you can look for usage examples of drupal_set_message().
--
If you have troubles with a particular contrib project, please consider to file a support request. Thanks.
--
Drupal services
My Drupal services
Ah, now I understand ;-)
Sorry, I misunderstood your first reply, I thought it only gave an answer to my first question. You're right, it is indeed better to redirect as usual and display a message with drupal_set_message() that contains the hyperlinks for the next steps.
Thanks for your suggestion !