This issue is simply when managing content from the admin section at admin/content/node.

The original issue was that the ?destination= in the edit links from that page were breaking the $form_state['redirect'] option in the submit handler.
I used a simple unset($_REQUEST['destination']) to avoid this, and allow the Save & Edit button to work properly.

The issue now is that I'm trying to reattach the original ?destination= value to the $form_state['redirect'] so that eventually, after they actually save or publish the node, it WILL redirect them back to the proper admin/content/node rather than the node view page.

Minor issue, but still needs to be worked out.


himerus’s picture

Status:Active» Needs work
mojo78’s picture

I had a similar problem, i.e. a previously-set destination was causing a problem when i wanted to redirect a completed form through another url.

The solution i implemented (which works, but would love to hear a more "drupal-ish" way of doing it) was:

     $dest = $_REQUEST['destination'];

     drupal_goto( 'some/drupal/path', 'destination='.urlencode($dest));
himerus’s picture

I had pulled up this issue a couple weeks back to make an attempt at it, and only spent a short bit of time on it before giving up for now...

The main issue is in this situation, the module is using $form_state['redirect'] to set where the form should go if the save & edit button was used.

The real issue presents itself if:

  • You visit admin/content/node
  • You select a node to edit
  • You use save & edit to redirect back to the node form again
    • This is where the destination is lost

In order to make this work, I need to continue to pass along the $destination every time it exists to the next node form, so that after hitting save & edit 100 times or more that it would still take you back to the original page you entered from, in this case admin/content/node.

I may actually pull this up again here in a moment and test another method. I may have figured it out just by talking about the issue again!

himerus’s picture

Status:Needs work» Fixed

Okay, I magically fixed this in 6.x-1.5.

The $form_state['redirect'] had given me issues before, and I finally found the solution that let me continue to pass the ?destination to EACH subsequent call to the Save & Edit button, and no matter how many times you Save & Edit, you will eventually end up back at admin/content/node if that is where you started your edit from.

$form_state['redirect'] = url('node/'. $form_state['nid']. '/edit',
    'query' => array(
      'destination' => $_REQUEST['destination'],
   'absolute' => TRUE,             

I was having issues with the redirection being sent to a page not found until I set the 'absolute' to TRUE, then it worked like a charm... tested, committed, tagged.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.