What I often need is a redirect to the previous page after creating a node (for example a task).
When the task node create form is embedded in the tasks overview page (as a panel pane for example) as form block, a refresh of the current page is needed after task creation.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | redirect-current-page-2425477-3.patch | 724 bytes | marabak |
Comments
Comment #1
rob holmes commentedHi, did you have any ideas on how to implement this functionality? If you make a start i am more than happy to finish it off and commit it.
Comment #2
nancydruBefore I got NSR working, I was adding
$_GET['q']to a field in the node form and then redirecting to it from the submission handler.$form['where_to'] = $_GET['q'];
...
$form_state['redirect'] = $form['where_to'];
Comment #3
marabak commentedHi,
I'm using this module to make drupal stay on the node's edit form after saving it - but with vertical tabs you can have a url pointing directly to a particular tab :
node/nid/edit/#id-of-the-vertical-tab
i've made a patch for this using the form hidden value : additional_settings__active_tab
Comment #4
rob holmes commentedIll try and get this tested and committed, we might have to make a conditional check for the existence of 'additional_settings__active_tab' before adding it as a fragment.
Comment #5
rob holmes commentedMoving to D8 first, backport later.
Comment #6
coaston commentedHello,
Is there any update? Really need to get back to previous page after create a new task.
I do have a content type School and I do have another content type building. In school I do have a views with building and added button to create a new building with the reference to School id (prepopulate). Once I save and create new building I am redirected to new building page, however need to get back to School - so previous page.
Comment #7
coaston commentedPrepopulate module did the trick in my case #6:
https://www.drupal.org/project/prepopulate/issues/3171915
Comment #8
smustgrave commented