the arguments to drupal_goto() changed, but form_state_redirect() is still trying to call it with the old argument structure when $form_state['redirect'] is an array.

attached patch seems to fix the issue

CommentFileSizeAuthor
fix_form_redirects.patch794 byteshunmonk

Comments

Status: Needs review » Needs work

The last submitted patch failed testing.

hunmonk’s picture

Title: bad call to drupal_goto() in form_state_redirect() » missing documentation for changes to $form_state['redirect'] structure
Component: forms system » documentation
Priority: Critical » Normal
Status: Needs work » Needs review

ok, after further investigation, the core code is correct, it's the upgrade documentation that's busted ;)

a search of http://drupal.org/update/modules/6/7 for both 'form' and 'redirect' doesn't yield any information about the change to the format of $form_state['redirect']. the upgrade doc should probably go something like this:

the format of $form_state['redirect'] has changed. it is now a numerically indexed array, the first element is the path, and the second element is an array of options that url() can take.

example:

6.x

  $form_state['redirect'] = array(
    'path' => 'foo',
    'query' => 'bar',
    'fragment' => 'baz',
  );

7.x

  $form_state['redirect'] = array(
    'foo',
    array(
      'query' => 'bar',
      'fragment' => 'baz',
    ),
  );
jhodgdon’s picture

Status: Needs review » Active

Any idea which issue/patch changed that behavior? The reason I am asking is that normally when we add stuff to the module upgrade guide, we link to the issue, and also if anything else changed in that issue's patch it gets documented there.

stborchert’s picture

jhodgdon’s picture

Status: Active » Closed (duplicate)

It looks like that issue is indeed where this was changed, and that issue is still open and marked "needs documentation" because it needs to be documented in the update guide.

So this issue is a duplicate.