Redirect doesn't work in ajax form Drupal 7

Hello everyone, I have no problems: There is a self-written module that creates a multi-step form on ajax. At the last step, when you click on submit, you should redirect to the page, the link to which is generated in the process of filling out the form. The problem is that the form pops up in the colorbox and the redirect does not work correctly: if you use

$form_state['rebuild'] = TRUE;
$form_state['redirect'] = 'some url';

Throws it to the view page sitename.ru/colorbox/my-page?width=800&height=450&maxWidth=1100&maxHeight=680&startStep=1 and outputs json on it. If you just write

drupal_goto('some url');

Then there is just an ajax request to this url and that's it, no redirect. I tried to remove ajax on the submit of the last step, it happens the same as in 1 case. At the same time, on the form page (not in colorbox), everything works out as it should.

Author: Revivelf, 2019-08-20

1 answers

I don't know what exactly happened, but everything works. If it helps someone, here's how it was decided: 1)I removed ajax processing from submit of the last step 2)Added 1 more step, inside which I wrote

drupal_goto('Нужный url');

3)Profit!

 0
Author: Revivelf, 2019-08-20 09:14:32